Cod sursa(job #1218735)

Utilizator forever16Alex M forever16 Data 12 august 2014 14:02:01
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <fstream>
#include <cstring>

using namespace std;
    ifstream f("text.in");
    ofstream g("text.out");
int text, litere=0, cuvinte=0;
bool cuv=false;
int main()
{
    while(!f.eof()) {
        text=f.get(); g<< text << "\n";
        if ((text>=65 && text<=90) || (text>=97 && text<=122))
            {   litere++;
                cuv=true; }
        else if (cuv==true)
            { cuvinte++;
            cuv=false; } ; }
    g<<litere/cuvinte;
    return 0;
}