Cod sursa(job #2211815)
| Utilizator | Data | 11 iunie 2018 22:07:53 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int lit = 0, cuv = 0, ok = 0;
char c;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(!feof(stdin))
{
scanf("%c", &c);
if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'))
{
++lit;
ok = 1;
}
else if (ok)
{
++cuv;
ok = 0;
}
}
if (ok)
++cuv;
printf("%d\n", lit / cuv);
return 0;
}
