Cod sursa(job #478415)

Utilizator johnny2008Diaconu Ion johnny2008 Data 18 august 2010 16:15:52
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include<fstream>
#include<string>
using namespace std;
string txt;
int i,l=0,cuv=0;
int main(){
	ifstream f("text.in");
	ofstream g("text.out");
	
	while(!f.eof()){
		f>>txt;
		cuv++;
		l=l+txt.length();
		
		for(i=0;i<txt.length();i++){
			
			if((int)txt[i]>122 || (int)txt[i]<65){
				if((int)txt[i]==45){
					cuv++;
					l--;
				}
				else{
					l--;
				}
			}
		}
		
	}
	g<<l/cuv;
	return 0;
}