Cod sursa(job #523298)
Utilizator | Data | 17 ianuarie 2011 18:29:52 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<fstream.h>
#include<string.h>
ifstream f ("text.in");
ofstream g("text.out");
char c;
int k,x,p;
int main ()
{while(!f.eof())
{
f>>c;
if ((c>'a' && c<'z') || (c>'A' && c<'Z'))
{
k++;
p=1;
}
else if (p) {p=0; x++;}
}
if (p) x++;
g<<(k/x+1);
f.close();
g.close();
return 0;
}