Cod sursa(job #1249485)

Utilizator adnionutCojocaru Ionut adnionut Data 27 octombrie 2014 00:03:59
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.48 kb
#include <fstream>
using namespace std;
 
ifstream fin ("text.in");
ofstream fout("text.out");

int lungime=0,cuvinte=0,aux=0;
char text;

int main()
{
    while(fin.get(text))
    {
        if((text<='z' && text>=97)||(text<='Z' && text>=65))
        {
            lungime++;
            aux=1;
        }
        else
            if(aux!=0)
            {
                cuvinte++;
                aux=0;
            }
    }
    fout<<lungime/cuvinte;
    return 0;
}