Cod sursa(job #2175221)

Utilizator RaresMacoveiMacovei Rares-Stefan RaresMacovei Data 16 martie 2018 16:03:09
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

int main()
{
    int l=0,nr=0,ok=0;
    char c;
    while(fin.get(c)){
       if((c>='a' && c<='z') || (c>='A' && c<='Z')){
         if(ok==0){
           ok=1;
           nr++;
         }
         l++;
       }
       else ok=0;
    }
    fout<<l/nr;
    return 0;
}