Cod sursa(job #1855214)

Utilizator comanalex33Coman Andrei Alexandru comanalex33 Data 23 ianuarie 2017 15:18:18
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
    int s=0,k=0;
    char a[100],*b;
    fin.get(a,99);
    b=strtok(a," -,!");
    while(b!=NULL)
    {
        s+=strlen(b);
        b=strtok(NULL," -,!");
        k++;
    }
    fout<<s/k;
    return 0;
}