Cod sursa(job #1090954)

Utilizator olteanuvladOlteanu Vlad olteanuvlad Data 23 ianuarie 2014 12:13:42
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
long i,nrl,bun,ok,nrc;
char c;
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    nrc=0;
    nrl=0;
    ok=0;
    while(c!='\n')
    {
        scanf("%c",&c);
        if((c>='A'&&c<='Z')||(c>='a'&&c<='z'))
        {
            nrl++;
            if(ok==0)
            {
                nrc++;
                ok=1;
            }
        }
        else ok=0;
    }
    printf("%d",nrl/nrc);
    return 0;
}