Cod sursa(job #2703721)

Utilizator ValiAntonieAntonie Valentin ValiAntonie Data 9 februarie 2021 09:41:40
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <fstream>

using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");
int nr,cuv,p;
char x;
int main()
{
while(fin.get(x)){
    if((x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z')){
        nr++;
        if(!p)
            p = 1;
    }
    else{
        if(p == 1){
            cuv++;
            p = 0;
        }
    }
}
fout << nr / cuv;
    return 0;
}