Cod sursa(job #2600609)
Utilizator | Data | 12 aprilie 2020 21:35:59 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
char s[1048578],
sep[100];
int main()
{
int dim=0;
for (int i=1;i<=127;++i)
if (!isalpha(char(i))){
sep[dim++]=char(i);
}
in.getline(s,1048576);
ull cnt=0,nr=0;
char *p=strtok(s,sep);
while (p){
cnt++;
nr+=strlen(p);
p=strtok(NULL,sep);
}
out<<nr/cnt;
}