Cod sursa(job #582197)

Utilizator george.buneaFMI George Bunea george.bunea Data 15 aprilie 2011 00:16:09
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
// [email protected] : Defines the entry point for the console application.
//

//#include "stdafx.h"
#include <fstream>
#include <string.h>

using namespace std;

int main(){
	ifstream f("text.in");
	ofstream g("text.out");

	char s[200],*p;
	int sum=0,nr=0,i;

	f.get(s,200);

	for(i=0;i<strlen(s);i++){
		if(isalpha(s[i]))sum++;
		else if(isalpha(s[i-1])&& !isalpha(s[i])) nr++;
	}
	g<<sum/nr;

	f.close();
	g.close();

}