Cod sursa(job #1393250)
Utilizator | Rotaru Gheorghe-Iulian iulianrotaru | Data | 19 martie 2015 11:16:16 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");ofstream fout("text.out");
int cuvinte,i,total,medie;
char text;
int main()
{
while(fin.get(text))
{
if((text>='A'&&text<='Z')||(text>='a')&&(text<='z'))
{
total++;
while((fin.get(text)&&text!='\0')&&((text>='A'&&text<='Z')||(text>='a'&&text<='z'))) total++;
cuvinte++;
}
}
medie=total/cuvinte;
fout<<medie;
return 0;
}