Cod sursa(job #953409)
Utilizator | Emanuel Truta manutruta | Data | 26 mai 2013 00:00:23 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#define endl '\n'
ifstream f("text.in");
ofstream g("text.out");
char c;
long long nrlit, nrcuv, init;
int main()
{
while(f.get(c))
{
if((c >= 'a' && c <= 'z') || ( c >= 'A' && c <= 'Z'))
++nrlit,
init = 1;
else if(init)
++nrcuv,
init = 0;
}
g << nrlit / nrcuv;
}