Cod sursa(job #1312895)

Utilizator savigunFeleaga Dragos-George savigun Data 10 ianuarie 2015 02:25:37
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.55 kb
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;

int main()
{
    ifstream in("text.in");
    ofstream out("text.out");
    long int c=0, l=0, ok=0, ne;
    char s;
    ne=0;
    while(ne<2)
    {
        in.get(s);
        if(s=='\n') ne++;
        else
        if((s>='a' && s<='z') || (s>='A' && s<='Z'))
        {
            l++;
            ok++;
        }
        else
        {
            if(ok!=0)
                c++;
            ok=0;
        }

    }
    if(c) out<<l/c;

    return 0;
}