Cod sursa(job #273180)
| Utilizator | Data | 8 martie 2009 12:02:48 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.55 kb |
#include <stdio.h>
char c,uc;
int k,a;
int main ()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
scanf("%c",&uc);
if (uc>='a'&&uc<='z' || uc>='A'&&uc<='Z') k=1;
else k=0;
do {
uc=c;
scanf("%c",&c);
if (uc>='a'&&uc<='z' || uc>='A'&& uc<='Z') {
k++;
if (!(c>='a'&&c<='z' || c>='A'&&c<='Z')) a++;
}
}while (!feof(stdin));
if (uc>='a'&&uc<='z' || uc>='A'&&uc<='Z') a++;
printf("%d", k/a);
return 0;
}