Cod sursa(job #666887)
Utilizator | Data | 22 ianuarie 2012 13:47:20 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<stdio.h>
#include<string.h>
int main()
{
freopen("text.in", "r",stdin);
freopen("text.out", "w", stdout);
char c,a='0';
int lit=0, cuv=1;
while((c=getchar())!=EOF)
{
if (c>='A' && c<='z') lit++;
else if (c==' '&& a!=' ') cuv++;
a=c;
}
printf("%d", lit/cuv);
return 0;
}