Cod sursa(job #921303)

Utilizator gbi250Gabriela Moldovan gbi250 Data 20 martie 2013 21:46:06
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <cctype>
#include <cstdio>
#include <cstring>
using namespace std;
char s;
int nr, ma;
bool sw;
int main()
{
    freopen("text.in", "r", stdin);
    freopen("text.out", "w", stdout);

    while(scanf("%c", &s)==1)
    {
        if(isalpha(s))
            ma++, sw=1;
        else if(sw)
            nr++, sw=0;
    }
    printf("%d\n", (int)(ma/nr));
    return 0;
}