Cod sursa(job #553074)
| Utilizator | Data | 13 martie 2011 15:55:06 | |
|---|---|---|---|
| Problema | Text | Scor | 90 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<stdio.h>
#include<string.h>
int i,s,nr;
char ch,ch2=' ';
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while (!feof(stdin))
{
scanf("%c",&ch);
if ((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))
s++;
else if ((ch2>='a'&&ch2<='z')||(ch2>='A'&&ch2<='Z')) nr++;
ch2=ch;
}
printf("%d\n",s/nr);
return 0;
}
