Cod sursa(job #728621)
Utilizator | Data | 28 martie 2012 20:28:49 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<string>
#include<cstdio>
#define in "text.in"
#define out "text.out"
int main()
{
bool ok=0;
freopen (in,"r",stdin);
freopen (out,"w",stdout);
char c;
int l=0,cuv=0;
while(scanf("%c",&c) && (c!='\n'))
{
if(isalpha(c))
{
ok=1;
++l;
}
else if(ok)
{
ok=0;
++cuv;
}
}
printf("%d",l/cuv);
return 0;
}