Cod sursa(job #1521008)

Utilizator dragos99Homner Dragos dragos99 Data 9 noiembrie 2015 20:11:33
Problema Text Scor 80
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 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 || c==','&& ok==1 || c=='.'&& ok==1 || c=='!'&& ok==1|| c=='?'&& ok==1 || c==';'&& ok==1 || c==':'&& ok==1 || c=='('&& ok==1 || c==')'&& ok==1)
        {a++;
        ok=0;}

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