Cod sursa(job #582199)

Utilizator george.buneaFMI George Bunea george.bunea Data 15 aprilie 2011 00:23:17
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 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);

	p=strtok(s," !@#$%^&*()_+|.,;[]/?");

	while(p){
		sum+=strlen(p);
		nr++;
		p=strtok(NULL," !@#$%^&*()_+|.,;[]/?");
	}

	g<<sum/nr;

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

}