Cod sursa(job #1312889)

Utilizator savigunFeleaga Dragos-George savigun Data 10 ianuarie 2015 01:17:19
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 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;
    char s;

    while((int)s!=4)
    {
        in.get(s);
        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;
}