Pagini recente » Cod sursa (job #2821259) | Cod sursa (job #865033) | Cod sursa (job #3230612) | Cod sursa (job #636949) | Cod sursa (job #582199)
Cod sursa(job #582199)
// [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();
}