Cod sursa(job #1513835)

Utilizator CalarisPredut Denis Stefanita Calaris Data 30 octombrie 2015 00:26:26
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.53 kb
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    int x,OK=0,length = 0,nr=0;
    char character;
    fstream f("text.in");
    ofstream g("text.out");
    while(!f.eof()){
            f.get(character);
            if(((character >= 'A')&&(character<='Z'))||((character >= 'a')&&(character<='z'))){
           OK = 1;
          length++;
           }
           else if((OK==1)){
            nr++;
            OK = 0;
           }
    }
    length = length/nr;
    g<<length;
    return 0;
}