Cod sursa(job #1440278)

Utilizator AwFuLLLParaschiv Marius AwFuLLL Data 23 mai 2015 12:06:56
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <iostream>
#include <fstream>
#include <string.h>

using namespace std;

int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
    char *p,s[255];
    int suma=0,c=0;
    f.get(s,255);
    p = strtok (s," ,.-");
  while (p != NULL)
  {
    suma+=strlen(p);
    p = strtok (NULL, " ,.-");
    c++;
  }
  g<<suma/c;
    return 0;
}