Cod sursa(job #1199341)

Utilizator mantisVraciu Stefan mantis Data 18 iunie 2014 21:46:58
Problema Text Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.35 kb
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int lmax,nr=1;
char c;
int main()
{
    c=f.get();
    while(c!=EOF)
    {
        if((c>=65 && c<=90)||(c>=97 &&c<=122)||c==45)
            lmax++;
        if(c==' ')
            nr++;
        c=f.get();
    }
    g<<lmax/nr;
	g.close();
	return 0;
}