Cod sursa(job #608889)

Utilizator DaNutZ2UuUUBB Bora Dan DaNutZ2UuU Data 18 august 2011 16:04:57
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <fstream.h>

ifstream f("cifra.in");
ofstream g("cifra.out");

#include <fstream>
#include <ctype.h>
using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

char c;
int L,NR;

int main() {
	while(!fin.eof()) {
		fin.get(c);
		if(isalpha(c)) {
			while(!fin.eof() && isalpha(c)) {
				L++;
				fin.get(c);
			}
			NR++;
		}
	}
	if(NR==0) {
		fout << "0";
		return 0;
	}
	fout << L/NR;
}