Cod sursa(job #2613358)

Utilizator divianegoescuDivia Negoescu divianegoescu Data 9 mai 2020 16:22:30
Problema Text Scor 30
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int n,l,i;
int litera(char x){
    if(x>='a' && x<='z')return 1;
    return 0;
}
char s[1000002];
int main(){
    fin.getline(s,1000001);
    for(i=0;s[i];)
        if(!litera(s[i]))
            i++;
        else{
            n++;
            while(litera(s[i]))
                l++,i++;
        }
    fout<<l/n;
    return 0;
}