Cod sursa(job #1327793)

Utilizator Andrei66Andrei Rusu Andrei66 Data 27 ianuarie 2015 09:19:10
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include <iostream>
#include <fstream>
#include <string.h>
#define VM 99999999

using namespace std;

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

char s[VM];

int sm=0,cuv=0;

int main()
{
    f.getline(s,VM);

    char* p;

    p=strtok(s," .,/;-=+[]{}");

    while(p){
      sm+=strlen(p);
      ++cuv;
      p=strtok(0," .,/;-=+\|[]{}");
    }

    g<<sm/cuv;

    return 0;
}