Cod sursa(job #2069742)
| Utilizator | Data | 18 noiembrie 2017 19:38:38 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int i;
char text[256],*p,*aux;
fin.get(text,255);
p=strtok(text," ");
int suma=0,nrcuvinte=0;
while (p!=NULL)
{
for (i=0;i<strlen(p);i++)
{
if (p[i]>='A' && p[i]<='z') suma++;
}
nrcuvinte++;
p=strtok(NULL, " ");
}
cout << suma/nrcuvinte;
return 0;
}
