Cod sursa(job #2270145)
Utilizator | Data | 27 octombrie 2018 09:39:28 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{ char a[1000],*p,sep[]=" !,-*?;";
int i,lungime=0,nrcuv=0;
f.get(a,1000);
p=strtok(a,sep);
while(p)
{
nrcuv++;
lungime=lungime+strlen(p);
p=strtok(NULL,sep);
}
g<<lungime/nrcuv<<'\n';
return 0;
}