Cod sursa(job #1148909)
Utilizator | Data | 21 martie 2014 11:44:50 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <cstdio>
using namespace std;
long s,cuv,r;
char c;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
scanf("%c",&c);
while (c>29)
{
if (((c>='a')&&(c<='z'))||((c>='A')&&(c<='Z')))
{
if (cuv==0) r++;
cuv=1; s++;
}
else
cuv=0;
scanf("%c",&c);
}
printf("%ld",s/r);
return 0;
}