15.06.2014, 15:45
I've tried this:
somewhere:
test[3];
test[0] = 12;
test[1] = 11;
test[2] = 44;
new value = ReturnMax(test);
but that doesn't seem to help.
somewhere:
test[3];
test[0] = 12;
test[1] = 11;
test[2] = 44;
new value = ReturnMax(test);
Код:
stock ReturnMax(string[]) { new maxi = -1,maxcount,value[2]; for(new i = 0; i < strlen(string); i++) { if(string[i] > maxi) { maxi = string[i]; maxcount = 1; } else if(string[i] == maxi) maxcount++; } value[0] = maxcount; value[1] = maxi; return value; }