Cod sursa(job #1520999)

Utilizator dragos99Homner Dragos dragos99 Data 9 noiembrie 2015 20:06:48
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.35 kb
#include<fstream>
using namespace std;
long a,nr,ok,p;
char c;
int main()
{
    freopen("text.in","r",stdin);
    ofstream g("text.out");

while(scanf("%c",&c)!=EOF)
{
    if(c>=65 && c<=90 || c>=97 && c<=122)
        {nr++;
        ok=1;}
    if(c==' ' && ok==1 || c=='-' && ok==1 || c=='\n'&& ok==1)
        a++;

}
g<<nr/a;
return 0;
}