Cod sursa(job #1505454)

Utilizator PaulStighiStiegelbauer Paul-Alexandru PaulStighi Data 19 octombrie 2015 10:47:26
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <iostream>
#include <fstream>
#define DM 1024*1100
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");

char e;
int S,c,nr;

int main ()
{

    int i,ok=1;

    while(fin.get(e))
    {
        if((e>='a' && e<='z') || (e>='A' && e<='Z'))
        {
            S++;
            if(ok==0)
            {
                nr++;
                ok=1;
            }
        }
        else    ok=0;
    }

    fout<<S/nr;

    fin.close();
    fout.close();
    return 0;
}