Cod sursa(job #1510683)

Utilizator beatrice01Ferco Beatrice beatrice01 Data 25 octombrie 2015 15:05:32
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb

#include <fstream>
#include <string.h>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
char a[1000],mat[100][30],sep[]="-., :;?/'_<>()",*p;
int n=0,total=0;

int main()
{
    fin.getline(a,1000);
    p=strtok(a,sep);
    while(p)
     {
         strcpy(mat[n],p);
         for(int i=0;i<strlen(mat[n]);i++) total++;
         n++;
         p=strtok(NULL, sep);

     }
     fout<<(total)/n;

    return 0;
}