Cod sursa(job #329244)
Utilizator | Data | 5 iulie 2009 14:32:28 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.63 kb |
#include<iostream.h>
#include<stdio.h>
unsigned long int litere,cuv;
char ch;
int main()
{
freopen("text.in","r",stdin);freopen("text.out","w",stdout);
while(scanf("%[ \n]c",&ch)!=EOF)
if((ch>='a' && ch<='z') || (ch>='A' && ch<='Z'))
{cuv++;
do {litere++;scanf("%c",&ch);}
while((ch>='a' && ch<='z') || (ch>='A' && ch<='Z'));
}
printf("%lu",litere/cuv);
fclose(stdin);fclose(stdout);
return 0;
}