Cod sursa(job #2316162)

Utilizator iustin948Homoranu Iustin iustin948 Data 11 ianuarie 2019 12:31:40
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.58 kb
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

bool Litera(char x)
{
    if((x >='a' && x <= 'z') || (x >='A' && x <= 'Z'))
        return 1;
    return 0;
}

int main()
{
    int i,nrcuv,nr;
    nrcuv = nr = 0;
    char x, y;
    while(fin.get(x))
        {
            if(Litera(x))
            {
            nr++;
            }

            if(!Litera(x) && Litera(y) )
                nrcuv++;
                y = x;
        }

    fout << nr/nrcuv << "\n";
    return 0;
}