Cod sursa(job #1903424)
Utilizator | Cioltan Andrei andy1207 | Data | 5 martie 2017 11:26:34 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.55 kb |
#include<cstdio>
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int cuv=0,l=0;
char c;
while(!feof(stdin))
{
scanf("%c",&c);
int q=0,pp=0;
while((c>='A' && c<='Z') || (c>='a' && c<='z'))
{
scanf("%c",&c);
if((c>='A' && c<='Z') || (c>='a' && c<='z'))
q++;
pp=1;
}
if(pp==1)
{
q++;
l+=q;
cuv++;
}
}
printf("%d\n",l/cuv);
return 0;
}