Cod sursa(job #2600606)
Utilizator | Data | 12 aprilie 2020 21:30:30 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
char s[1048578],
sep[77]="\ !#$%&'()*+,-./0123456789:;<=>?@[]^_`{|}~\t";
;
int main()
{
sep[41]='"';
sep[42]='\t';
in.getline(s,1048576);
int cnt=0,nr=0;
char *p=strtok(s,sep);
while (p){
cnt++;
nr+=strlen(p);
p=strtok(NULL,sep);
}
out<<nr/cnt;
}