Cod sursa(job #1248569)

Utilizator bulbulicaAlexandrescu Cristian bulbulica Data 25 octombrie 2014 15:50:02
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <fstream>
using namespace std;

ifstream f("text.in");
ofstream g("text.out");

int main()
{
    int lungime=0,cuvinte=0,ceva=0;
	char text;
    while(f.get(text))
    {
        if((text<='z' && text>='a')||(text<='Z' && text>='A'))
        {
            lungime++;
            ceva=1;
        }
        else
            if(ceva!=0)
            {
                cuvinte++;
                ceva=0;
            }
    }
    g<<lungime/cuvinte;
    return 0;
}