Cod sursa(job #945528)

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

using namespace std;

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