Pagini recente » Cod sursa (job #1988395) | Cod sursa (job #1080936) | Cod sursa (job #1687821) | Diferente pentru problema/grendizer intre reviziile 20 si 21 | Cod sursa (job #1988638)
#include <iostream>
#include <fstream>
#include <cstring>
#define M 1000000
using namespace std;
int main()
{
char s[M], *p;
int cuv = 0, x = 1;
ifstream f("text.in");
ofstream g("text.out");
f.get(s, M);
p = strtok(s, " ,.!?;");
while(p)
{
cuv += strlen(p);
p = strtok(NULL, " ,.!?;");
x++;
}
g << cuv/x;
return 0;
}