Mai intai trebuie sa te autentifici.
Cod sursa(job #2428937)
Utilizator | Data | 6 iunie 2019 22:06:42 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.59 kb |
#include <iostream>
#include <fstream>
#include <cstring>
#define MAX 100000000
using namespace std;
char c[MAX];
int main()
{
ifstream in("text.in");
ofstream out("text.out");
in.getline(c,MAX);
unsigned long sum = 0,contor = 0;
char sep[100]=" ,._`-!?{)*123456780&^'%$#~=+|(@!}/[]\ ";
char *p;
p= strtok(c,sep);
while(p!= NULL)
{
contor++;
sum +=strlen(p);
cout<<p<<endl;
p=strtok(NULL,sep);
}
//cout<<sum<<endl<<contor<<endl;
out<<sum/contor;
return 0;
}