Cod sursa(job #1670575)

Utilizator bob123bobelus bob bob123 Data 31 martie 2016 20:57:31
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.63 kb
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int lit,nrc,l,k,i;
char v[]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char s[5000003];
int main()
{
    f.getline(s,5000000);
    l=strlen(s);
    while(i<l){
        k=0;
        while(strchr(v,s[i])){
            if(k==0)++nrc;
            ++lit;
            ++i;
            k=1;
        }
        ++i;
    }
    g<<lit/nrc;
    return 0;
}