Cod sursa(job #695871)
| Utilizator | Data | 28 februarie 2012 15:17:03 | |
|---|---|---|---|
| Problema | Text | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<cstdio>
#include<cstring>
int n,i,j,k,x;
char v[100000000];
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(v);
for (i=0;i<strlen(v)-1;++i)
if ((v[i]==' ')||(v[i]=='-'))
{
if (((v[i+1]>='a')&&(v[i+1]<='z'))||((v[i+1]>='A')&&(v[i+1]<='Z')))
k++;
}
else {
if (((v[i]>='a')&&(v[i]<='z'))||((v[i]>='A')&&(v[i]<='Z'))) x++;
}
printf("%d",x/k);
return 0;
}