Cod sursa(job #1491627)

Utilizator vladdy47Bucur Vlad Andrei vladdy47 Data 25 septembrie 2015 19:17:54
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <cstdio>
#include <cctype>
 
using namespace std;
int nrlit,nrcuv;
char c;
 
bool ok=false;
int main ()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    while (scanf("%c",&c)!=EOF)
    {
        if (isalpha(c))
        {
            nrlit++;
            if (!ok)
            {
                nrcuv++;
                ok=true;
            }
        }
        else ok=false;
 
 
    }
 
    printf("%d",nrlit/nrcuv);
 
    return 0;
}