Pagini recente » Cod sursa (job #1394866) | Cod sursa (job #2353933) | Cod sursa (job #1134499) | Cod sursa (job #2677658) | Cod sursa (job #582201)
Cod sursa(job #582201)
// [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();
return 0;
}