Cod sursa(job #1477617)
Utilizator | Data | 26 august 2015 16:36:57 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <cstdio>
#include <algorithm>
#include <cstring>
int l, nrc;
bool ok;
char s;
int main()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
while ( scanf("%c", &s) != EOF)
{
if (( s <= 'Z' && s >= 'A' ) || ( s <= 'z' && s >= 'a' ))
{
l++;
if (!ok)
++ nrc;
ok = 1;
}
else
ok = 0;
}
printf("%d", l / nrc);
return 0;
}