Cod sursa(job #273189)
| Utilizator | Data | 8 martie 2009 12:08:04 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include<stdio.h>
#include<string.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;
}
