Cod sursa(job #562701)

Utilizator AndreiukAndrei C Andreiuk Data 23 martie 2011 18:33:05
Problema Text Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <fstream>
//#include <string>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char a;
int cuvant,litere,k;
int main()
{  
	while(f>>a)  {  
	                 if((a>='a' && a<='z') || (a>='A' && a<='Z')) { 
	                                                            litere++;
																if(k==0) { cuvant++; 
																		   k=1;
																		}
                                                                  }
					else k=0;
                 }

 g<<litere/cuvant;
 f.close();
  g.close();
  return 0;
}