Pagini recente » Istoria paginii runda/infinity-2022-10 | Rating Mintas Alex Andrei (AlexAndrei11) | Istoria paginii runda/luni_ora_17 | Cod sursa (job #2594491) | Cod sursa (job #1134196)
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
char s[101],sep[]=".,;:!-? ",a[100][100],*p;
int n,i,suml;
ifstream fin("text.in");
ofstream fout("text.out");
fin.getline(s,100);
p=strtok(s,sep);
n=0;
while(p)
{
strcpy(a[n],p);
n++;
p=strtok(NULL,sep);
}
suml=0;
for(i=0;i<n;i++)
suml+=strlen(a[i]);
fout<<suml/n;
return 0;
}