Return max, and repeating from string array.
#1

I've tried this:
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;
}
but that doesn't seem to help.
Reply


Messages In This Thread
Return max, and repeating from string array. - by [WSF]ThA_Devil - 15.06.2014, 15:45
Re: Return max, and repeating from string array. - by Konstantinos - 15.06.2014, 16:17
Re: Return max, and repeating from string array. - by [WSF]ThA_Devil - 15.06.2014, 17:27

Forum Jump:


Users browsing this thread: 1 Guest(s)