Cod sursa(job #3125214)
Utilizator | Data | 2 mai 2023 12:16:13 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char sep[10]=" .,?!~:;-";
char c[10001];
int main()
{
f.getline(c,10001);
int i;
char *p;
p=strtok(c,sep);
long long s=0;
int cuv=0;
while(p)
{
s=s+strlen(p);
cuv++;
p=strtok(NULL,sep);
}
g<<s/cuv;
return 0;
}