Cod sursa(job #1249486)

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

int lung=0,cuv=0,aux=0;
char text;

int main()
{
    while(fin.get(text))
    {
        if((text<=122 && text>=97)||(text<=90 && text>=65)) // 97=a 65=A 90=Z 122=z
        {
            lung++;
            aux=1;
        }
        else
            if(aux!=0)
            {
                cuv++;
                aux=0;
            }
    }
    fout<<lung/cuv;
    return 0;
}