Cod sursa(job #1248537)

Utilizator Aronn00Vladutu Georgian Aronn00 Data 25 octombrie 2014 14:24:41
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include<iostream>
#include<fstream>
using namespace std;
int main(){
	ifstream f("text.in");
	ofstream g("text.out");
	int count = 0, word = 0;
	int ok=0;
	while (!f.eof()){
		b = f.get();
		if (b >= 'a' && b <= 'z' || b >= 'A' && b <= 'Z'){
			count++;
			if(ok==0){
				word++;
				ok=1;
			}

		}
		else
			ok=0;
	}

	g<<(int)(count/word);


	return 0;
}