Cod sursa(job #3159707)

Utilizator MihaiZ777MihaiZ MihaiZ777 Data 21 octombrie 2023 20:15:17
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.29 kb
#include<fstream>
using namespace std;
ifstream f("text.in");
int w,l;
bool y;
char c;
int main()
{
    while(f.get(c))
        if(isalpha(c)) {
            if(!y)
                y=1,++w;
            ++l;
        } else
            y=0;
    ofstream("text.out")<<l/w;
    return 0;
}