Cod sursa(job #945540)

Utilizator robertstrecheStreche Robert robertstreche Data 2 mai 2013 11:18:55
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include <fstream>

using namespace std;

ifstream f("text.in");
ofstream g("text.out");
char c;
long long n,nr,y,ok;
int main()
{
    while (f>>noskipws>>c && c!='\n')
    {
        if((c>=97 && c<=122) || (c>=65 && c<=90))nr++;
        else
        {
            if (nr)y++;
            n+=nr;
            nr=0;

        }
    }
    if (!y)y++;
    g<<n/y;
   f.close();
   g.close();
}