Cod sursa(job #918439)
| Utilizator | Data | 18 martie 2013 21:16:38 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <cstdio>
using namespace std;
char c;
long long s1, s, nrlitere;
int main ()
{
freopen ("text.in", "r", stdin);
freopen ("text.out", "w", stdout);
while (scanf ("%c", &c))
{
if (int (c) == 10) break;
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) s1++;
else
{
if (s1 != 0) s++;
nrlitere += s1;
s1 = 0;
}
}
printf ("%lld\n", nrlitere / s);
return 0;
}
