Pagini recente » Cod sursa (job #2066478) | Cod sursa (job #1350249) | algoritmiada-2019/runda-finala/solutii/bisuma | Cod sursa (job #2316754) | Cod sursa (job #637115)
Cod sursa(job #637115)
#include<iostream>
#include<string.h>
#include<fstream>
using namespace std;
int main()
{char s[256], *p, sep[]=" ,?!-";
int nch=0 ,nsb=0;
ifstream F("text.in",ios::in);
ofstream G("text.out",ios::out);
F.getline(s,256);
p=strtok(s,sep);
while(p)
{nsb++;
nch+=strlen(p);
p=strtok(NULL,sep);
}
G<<nch/nsb;
return 0;
}