Cod sursa(job #163945)

Utilizator jupanu92Anonim jupanu92 Data 23 martie 2008 12:46:44
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include<fstream>
using namespace std;
int main()
{char c;
long i,nrl;
int ok,okk;
ifstream fin("text.in");
ofstream fout("text.out");
i=0;nrl=0;
fin.get(c);
okk=0;
do{ok=0;
   while(c>='a'&&c<='z' || c>='A'&&c<='Z'){nrl++;fin.get(c);ok=1;}
   fin.get(c);
   if(ok==1){i++;okk=1;}

   }while((int)c!=-1);


if(okk==1)fout<<nrl/i;
fin.close();
fout.close();
return 0;
}