Cod sursa(job #1084233)

Utilizator dianaa21Diana Pislaru dianaa21 Data 16 ianuarie 2014 19:21:32
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.53 kb
#include <fstream>
#include <string>
using namespace std;
ifstream is ("text.in");
ofstream os ("text.out");
int Lit (char x);
int main()
{
    int l = 0, cuv = 0;
    string s;
    char x[] = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
    getline(is, s, (char)EOF);
    size_t t = s.find_first_of (x);
    size_t q;
    while (t != string::npos)
    {
        q = s.find_first_not_of(x, t);
        l += q-t;
        cuv++;
        t = s.find_first_of(x, q);
    }
    os << l/cuv;
    return 0;
}