Cod sursa(job #727696)
| Utilizator | Data | 28 martie 2012 10:50:55 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include<cstdio>
int main()
{
int ok=0,nrcuvinte=0,lungimetotala=0;
char c;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
for(;scanf("%c",&c)+1;)
{
if(!ok)
{
if((c>='a'&&c<='z')||(c>='A'&&c<='Z')) {ok=1; lungimetotala++; nrcuvinte++;}
}
else
{
if((c>='a'&&c<='z')||(c>='A'&&c<='Z')) {lungimetotala++;}
else {ok=0;}
}
}
printf("%d\n",lungimetotala/nrcuvinte);
return 0;
}
