Cod sursa(job #1929396)

Utilizator GeorginskyGeorge Georginsky Data 17 martie 2017 16:19:00
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
string s;
unsigned long long nr, w, l;
int main(){
    char x;
    while(in.get(x)){
        if(('a'<=x&&x<='z')||('A'<=x&&x<='Z')){
            w++;
        }else{
            if(w>0)nr++;
            l+=w;
            w=0;
        }
    }
    out<<l/nr;
    return 0;
}