Cod sursa(job #2200471)

Utilizator bestkid1234Ovi Ovi bestkid1234 Data 1 mai 2018 15:49:16
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <iostream>
#include <fstream>
#include <cctype>
#include <cstring>

using namespace std;

ifstream fin("text.in");
ofstream fout ("text.out");

int main()
{
	char s[400], *p;
	int c=0,l=0;
	fin.getline(s,400);
	p = strtok(s," ,-;?:!");
	while(p!=NULL)
	{
		l=l+strlen(p);
		c++;
		p=strtok(NULL," ,-;?:!");
	}
	fout<<l/c;
	return 0;
}