Cod sursa(job #2076097)

Utilizator gumitza68Marsky7 gumitza68 Data 26 noiembrie 2017 10:18:39
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
    char s[1000000];
    int j=0,su=0;
    while(f.get(s,10000))
        {char *p=strtok(s," ,!-@#$%^&*()_+=./|\'""[]{}");
        while(p!=NULL)
        {
            su=su+strlen(p);
            j++;
            p=strtok(NULL," ,!-@#$%^&*()_+=./|\'""[]{}");
        }
        }
g<<(int)su/j;
return 0;
}