Cod sursa(job #508251)
Utilizator | Data | 7 decembrie 2010 22:24:27 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<fstream.h>
#include<string.h>
#include<stdio.h>
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char c,cuv[30];
int k,p,t,l;
k=0,p=0,l=0;
while(f>>c)
if(c>='a'&&c<='z'||c>='A'&&c<='Z')cuv[++p]=c;
else
{
cuv[p]='\0';
p=0;
k++;
l=l+strlen(cuv);
}
t=l/k;
g<<t;
f.close();
g.close();
return 0;
}