Cod sursa(job #945539)

Utilizator robertstrecheStreche Robert robertstreche Data 2 mai 2013 11:17:22
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 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)
          {

            n+=nr;
            nr=0;
            y++;
          }
        }
    }
    if (!n)n++;

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