Cod sursa(job #774065)
Utilizator | Data | 3 august 2012 12:48:35 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<iostream.h>
int main()
{
int cuv=0,nr=0,k=0;
char ch;
ifstream fin("text.in");
ofstream fout("text.out");
while((fin>>ch)&&(ch!=EOF))
{
if((ch>'a'&&ch<'z')||(ch>'A'&&ch<'z'))
{
cuv++;k=1;
}
else
{
if(k==1)
{nr++;k=0;}
}
}
fout<<cuv/(nr+1);
return 0;
}