Cod sursa(job #2495724)

Utilizator TzigCurta Tudor Tzig Data 19 noiembrie 2019 19:40:33
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;
int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
    char s[1000000];
    f.getline(s,1000000);
    char *p=strtok(s," ,<.>/?;:'[{]}`~-_=+!123456789@#$%^&*()");
    int cuvinte=0;
    int lungime=0;
    while(p){
        cuvinte++;
        lungime=lungime+strlen(p);
        p=strtok(NULL," ,<.>/?;:'[{]}`~-_=+!123456789@#$%^&*()");
    }
    g<<lungime/cuvinte;;
    return 0;
}