Cod sursa(job #808859)

Utilizator mlupseLupse-Turpan Mircea mlupse Data 7 noiembrie 2012 15:39:03
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
using namespace std;
#include <fstream>
#include <cstring>
#include <ctype.h>
#define LMax 1050005
char x[LMax];
int main()
{
    ifstream eu ("text.in");
    ofstream tu ("text.out");
    char C;int i;
    eu.getline(x,LMax);i=0;
    while (x[i])
    {
        if (isalpha(x[i]))
        {
            do
            {
                ++LWords;
                i++;
            }
            while (x[i] and isalpha (x[i]));
            ++NWords;
        }
        else
            i++;
    }
    tu << LWords/NWords << "\n";

    return 0;
}