Cod sursa(job #2069166)

Utilizator cosceexcosceex cosceex Data 18 noiembrie 2017 12:13:16
Problema Text Scor 40
Compilator cpp Status done
Runda evaluare_cex_sv_cls_x Marime 0.54 kb
#include <bits/stdc++.h>

using namespace std;

ifstream f("text.in");
ofstream g("text.out");
char v[10000002];
char *p,separator[]="~`!@#$%^ &*()1234567890{}[]_-+=:;'|\<,>.?/";
int n,x;
int main()
{
    f.get(v,10000000);
    //strcpy(separator,"~`!@#$%^&*()1234567890{}[]_-+=:;'|\<,>.?/");
    p=strtok(v,separator);
    while(p)
    {
        n++;
        //strcpy(a[++n],p);
        x+=strlen(p);
        p=strtok(NULL,separator);
    }
    g<<x/n;
    //for(int i=1;i<=n;i++)
    //    g<<a[i]<<'\n';
    return 0;
}