Cod sursa(job #478420)

Utilizator johnny2008Diaconu Ion johnny2008 Data 18 august 2010 16:21:19
Problema Text Scor 80
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 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();
		if(txt.length()==1){}
		else{
		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;
}