Cod sursa(job #2555309)
Utilizator | Data | 23 februarie 2020 21:19:10 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char s[255], *cuvant;
int nr=0, nr1=0;
f.getline(s, 255);
cuvant=strtok(s, "- ,.?!,");
while(cuvant!=NULL) {
nr1+=strlen(cuvant);
nr++;
cuvant=strtok(NULL, "- ,.?!,");
}
g<<nr1/nr;
}