Cod sursa(job #1110305)
Utilizator | Data | 17 februarie 2014 22:48:25 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<fstream>
#include<cctype>
using namespace std;
ifstream f("text.in");
ofstream fout("text.out");
int main()
{
char x;
int l=0,cuv=0,y=0;
while(f.get(x))
{
if(isalpha(x)) ++y;
else
if(y) ++cuv,l+=y,y=0;
}
fout<<l/cuv;
return 0;
}