Cod sursa(job #1148914)
| Utilizator | Data | 21 martie 2014 11:52:56 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 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);
}
if (r!=0)
printf("%ld",s/r);
else
printf("0");
return 0;
}
