Cod sursa(job #128631)
Utilizator | Data | 27 ianuarie 2008 15:44:55 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include<fstream.h>
#include<string.h>
int main(){
char c;
int s=0,lung,ok,y=0;
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{ f.get(c);
ok=1;
lung=0;
while(ok!=0)
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{ lung++;f.get(c);}
else ok=0;
if(lung!=0) {s+=lung;y++;}
}
g<<(int)s/y;
return 0;
}