Cod sursa(job #1802914)

Utilizator gladiatoriglandrei123 gladiatorigl Data 10 noiembrie 2016 19:39:28
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <iostream>
#include <stdio.h>
#include <ctype.h>
using namespace std;
int s=0, c;
bool sw;
char x;
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    while(scanf("%c", &x)!=EOF)
    {
        sw=1;
        while (!isalpha(x)&&!EOF)
            scanf("%c", &x);
        while (isalpha(x)&&!EOF)
        {
            sw=0;
            s++;
            scanf("%c", &x);
        }
        if (sw==0)
            c++;
    }
    printf("%d", s/c);
    return 0;
}