Cod sursa(job #2069127)

Utilizator Urdoi.BogdanUrdoi Bogdan Urdoi.Bogdan Data 18 noiembrie 2017 12:06:02
Problema Text Scor 60
Compilator cpp Status done
Runda evaluare_cex_sv_cls_x Marime 0.4 kb
#include <fstream>
#include <cstring>

using namespace std;

ifstream f("text.in");
ofstream g("text.out");

int main()
{
    char s [500];
    int lungime = 0, numarCuv = 0, n;
    while (f >> s){
        numarCuv++;
        n = strlen(s);
        for (int i = 0; i < n; i++)
            if (isalpha(s[i]))
                lungime++;
    }
    g << lungime/numarCuv;
    return 0;
}