Cod sursa(job #1242641)

Utilizator denisa.checiuDenisa denisa.checiu Data 14 octombrie 2014 20:23:01
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <iostream>
#include <fstream>
#include <string.h>

using namespace std;

int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    char a;
    int i,nrc=0,ok=0,nrl=0;

    while(scanf("%c",&a)!=EOF)
    {
        if((a>='a' && a<='z') || (a>='A' && a<='Z'))
        {
            nrl++;
            if(ok==0)
            {
                nrc++;
              ok=1;
            }

        }
        else
        ok=0;

    }
    cout<<nrl/nrc;

    return 0;
}