Cod sursa(job #2076091)

Utilizator gumitza68Marsky7 gumitza68 Data 26 noiembrie 2017 10:13:00
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
    char s[1000],a[1000][1000];
    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;
}