Cod sursa(job #786301)

Utilizator icb_mnStf Cic icb_mn Data 10 septembrie 2012 22:19:18
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <fstream>

using namespace std;

ifstream f("text.in");
ofstream g("text.out");
int  eval(char c)
{
    if(c >= 'a' && c <= 'Z' || c >= 'A' && c <= 'Z') return 1;
    return 0;

}

void text()
{
    char c;

    int litere = 0,cuvinte = 0;

    while(f>>c)
    {
        if(eval(c) == 1)litere++;
        else
        cuvinte++;
    }

    g<<litere/cuvinte<<'\n';

}
int main()
{
    text();

    g.close();

    return 0;
}