Cod sursa(job #2209080)

Utilizator gabi08Dron Ionut-Gabriel gabi08 Data 1 iunie 2018 18:00:59
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <iostream>
#include <fstream>
#include <string.h>
#include <ctype.h>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
char c;
int nr_cuv=0,lungime=0;
int main()
{
    while(fin.get(c))
    {
        if(isalpha(c))
        {
             nr_cuv++;
             while(isalpha(c))
             {
                 lungime++;
                 fin.get(c);
             }
        }
    }
    fout<<lungime/nr_cuv;
    fin.close();
    fout.close();
    return 0;
}