Cod sursa(job #2418024)

Utilizator sidorencuoanaSidorencu Oana Alexandra sidorencuoana Data 2 mai 2019 21:59:51
Problema Text Scor 40
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <iostream>
#include <fstream>
#include <string.h>

using namespace std;

ifstream f("text.in");
ofstream g("text.out");

char s[100001],*p,sep[]=" ,-,.,!,?";
int n,k;

void Citire()
{
     f.get(s,100001);
     f.get();
     p=strtok(s,sep);
     while(p)
     {
          n+=strlen(p);
          k++;
          p=strtok(0,sep);

     }
     //g<<s;
     g<<n/k;
}

int main()
{Citire();
    cout << "Hello world!" << endl;
    return 0;
}