Cod sursa(job #782772)

Utilizator SeekHunt1334Septimiu Bodica SeekHunt1334 Data 30 august 2012 04:55:36
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.58 kb
#include <iostream>
#include <cstdio>
#include <fstream>
using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

int main()
{
    int nrc = 1, nrtl = 0;

    int thischar = getchar();
    while (thischar != '\n')
    {

        if ( thischar >= 97 && thischar <= 122 )
            nrtl++;
            else
            if ( thischar >= 65 && thischar <= 90 )
                nrtl++;
                else
                if ( thischar == ' ')
                    nrc++;
        thischar = getchar();
    }

    fout << nrtl/nrc;

    return 0;
}