Cod sursa(job #1520963)

Utilizator dragos99Homner Dragos dragos99 Data 9 noiembrie 2015 19:37:39
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include<fstream>
using namespace std;
long a,nr,ok;
char c;
int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
while(f.get(c))
{
    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;
}