Cod sursa(job #2175102)

Utilizator RaresMacoveiMacovei Rares-Stefan RaresMacovei Data 16 martie 2018 15:17:47
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <bits/stdc++.h>

using namespace std;

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

char c[1050000];

int main()
{
    fin.get(c,1050000);
    int l=strlen(c),i=0;
    int lc=0,nr=0;
    while(i<l){
        while(c[i]>'z' || c[i]<'A' && i<l) ++i;
        while(c[i]>='A' && c[i]<='z' && i<l) {
            if(c[i]<='z' && c[i]>='A') ++lc;
            ++i;
        }
        ++nr;
    }
    fout<<lc/nr;
    return 0;
}