Cod sursa(job #2062208)
Utilizator | Data | 10 noiembrie 2017 08:39:32 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s[100000000];
int main()
{
int sc=0,k=0;
char *p,del[]="., ?!-";
fin.getline(s,100000000);
p=strtok(s,del);
while(p)
{
sc=sc+strlen(p);
k++;
p=strtok(NULL,del);
}
fout << sc/k;
return 0;
}