Cod sursa(job #470812)
| Utilizator | Data | 15 iulie 2010 16:59:33 | |
|---|---|---|---|
| Problema | Text | Scor | 90 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
#include<fstream.h>
#include<iostream.h>
#include<math.h>
#include<string.h>
int main(){
ifstream f("text.in");
ofstream g("text.out");
char c;
long long s = 0, l = 0;
int nr = 0;
while (!f.eof()){
f.get(c);
if (isalpha(c))
l++;
else{
if (l > 0){
nr++;
s = s + l;
l = 0;
}
//g<<s<<" "<<l<<" "<<nr<<endl;
}
}
s = s/nr;
g<<s;
return 0;
}
