Cod sursa(job #2469021)

Utilizator Bogdan.1108Mandresi Bogdan Bogdan.1108 Data 6 octombrie 2019 13:46:55
Problema Text Scor 20
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <iostream>
#include <fstream>
#include <cstring>

using namespace std;

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

int main()
{
    int nrcuv = 1, nrlit = 0;
    char chestie[99];
    fin.getline(chestie, 99);
    for (int i = 0; i <= strlen(chestie); i++)
    {
        if (chestie[i] == ' ' || chestie[i] == '-') nrcuv++;
        if (chestie[i]>='a'&&chestie[i]<='z'||chestie[i]>='A'&&chestie[i]<='Z') nrlit++;
    }
    fout << nrlit/nrcuv;
    return 0;
}