15.06.2014, 16:17
pawn Код:
ReturnMax(&count, const string[], len)
{
count = 0;
new max_val = -1;
for (new i; i != len; ++i)
{
if (string[i] > max_val)
{
max_val = string[i];
count = 1;
}
else if (string[i] == max_val) ++count;
}
return max_val;
}
pawn Код:
test[0] = 44;
test[1] = 11;
test[2] = 44;
new
count,
value = ReturnMax(count, test, sizeof (test));
printf("%i %i", count, value);