Cod sursa(job #877959)

Utilizator usermeBogdan Cretu userme Data 13 februarie 2013 16:26:13
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include <fstream>
#include <cstring>

using namespace std;

char c[1000001],*p;

int s,k;

int main(){
    ifstream f("text.in");
    ofstream h("text.out");
    f.getline(c,1000001);
    p=strtok(c," ,!-?0123456789");
    while(p){
        k+=strlen(p);
        s++;
        p=strtok(NULL," ,!-?0123456789");
    }
    h<<k/s;
    return 0;
}