Cod sursa(job #1973637)

Utilizator andrei_ciobanuciobanu andrei andrei_ciobanu Data 25 aprilie 2017 16:51:06
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <fstream>
#include <iostream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
    char x;
    int litere=0,cuvinte=0,ok;
    while (x<65 || (x>90 && x<97) || x>122){
        in.get(x);
    }
    litere++;
    while (in.get(x)){
        if ((x>=65 && x<=90) || (x>=97 && x<=122)){
            litere++;
            ok=1;
        }else{
            if (ok==1){
                cuvinte++;
                ok=0;
            }
        }
    }
    out<<litere/cuvinte<<endl;
    return 0;
}