Cod sursa(job #200857)
Utilizator | Data | 27 iulie 2008 00:49:12 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<fstream.h>
#include<string.h>
ifstream fin("text.in");
ofstream fout("text.out");
char c;
unsigned long sum,cont,ok;
int main()
{
while(fin>>c)
{
if(c>='a' && c<='z' || c>='A' && c<='Z')
{
sum++;
ok=1;
}
else
{
if(ok==1)
cont++;
ok=0;
}
}
fout<<sum/cont;
fout.close();
return 0;
}