Cod sursa(job #2383897)

Utilizator 566577Cont566 566577 Data 19 martie 2019 21:10:47
Problema Text Scor 50
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <fstream>
#include <cstring>
using namespace std;

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

long long litere, cuvinte;
char x, y;
string text;

void rezolva(string a)
{
    while(fin.get(x))
    {
        if((x>='a' && x<='z') || (x>'A' && x<='Z'))
            litere++;
        else if((y>='a' && y<='z') || (y>='A' && y<='Z'))
            cuvinte++;
        y=x;
    }

    fout<<litere/cuvinte;
}

int main()
{
        fin>>text;
    rezolva(text);
    return 0;
}