Cod sursa(job #356243)
Utilizator | Data | 13 octombrie 2009 22:13:17 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <fstream.h>
#include <ctype.h>
int main ()
{ifstream f("text.in");
ofstream g("text.out");
int k=0,nr=0,ma,ok=0;
char c;
while (f>>c)
{ if (isalpha(c)) { nr++; ok=1;}
else if (ok==1) { k++; ok=0;}
}
if (ok==1) k++;
ma=nr/k;
g<<ma;
f.close ();
f.close ();
return 0;
}