Pagini recente » Rating Boghici Eusebiu (Boghici_Eusebiu) | Cod sursa (job #2535996) | Cod sursa (job #1895502) | Cod sursa (job #2718380) | Cod sursa (job #1131099)
#include <fstream>
#include <cstdio>
#include <cstring>
using namespace std;
FILE *f=fopen("text.in","r+");
ofstream g("text.out");
int main()
{
short k=0,L=0;
char sir[255],*p,sep[]=" , - ! . ";
p=new char[255];
fgets(sir,254,f);
p=strtok(sir,sep);
while(p!=NULL)
{
L+=strlen(p);
k++;
p=strtok(NULL,sep);
}
g<<L/k;
g<<'\n';
return 0;
}