Cod sursa(job #1248107)
Utilizator | Data | 24 octombrie 2014 17:51:43 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <stdio.h>
#include <stdlib.h>
int main()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
char c;
int k = 0, r = 0, ok = 0;
while(scanf("%c", &c) == 1)
{
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
{
k++;
if(ok == 0)
{
ok = 1;
r++;
}
}
else
ok = 0;
}
printf("%d", k/r);
return 0;
}