Cod sursa(job #258107)
| Utilizator | Data | 14 februarie 2009 18:35:09 | |
|---|---|---|---|
| Problema | Text | Scor | 50 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <stdio.h>
#define NR 1050000
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int litere=0,cuv=0;
char x,y;
while (scanf("%c",&x)!=EOF)
{
if ((x>='a' && x<= 'z') || (x>='A' && x<= 'Z') && y>='a' && (y<= 'z') || (y>='A' && y<= 'Z'))
litere++;
else
if ((y>='a' && y<= 'z') || (y>='A' && y<= 'Z') && (x<'A' || (x>'Z' && x<'a') || x>'z'))
++cuv;
y=x;
}
printf("%d",litere/cuv);
return 0;
}