查出第二大的数是多少

it2022-05-05  77

1   arr=[4,3,5,9,1,12,89,2,44] 3 for(t of arr){ 4 5 6 if(t> max) 7 max=t; 8 else { 9 if(t>sec) 10 sec=t; 11 } 12 console.log(max,sec,t) 13 }

这个代码查出 第二大的数是多少

转载于:https://www.cnblogs.com/qgbo/p/11171567.html


最新回复(0)