728x90
반응형
  for i = 0 to UBound(CMT)
        for j = i+1 to UBound(CMT)
         response.write CMT(i) &"보다" &CMT(j) &"가 크다면  swap <br/>"

     if (CMT(i) > CMT(j)) then 
        call swap(i, j)    
     end if
        next
    next


 function swap(i, j)
     valor_1_antigo = CMT(i)
     valor_2_antigo = CMT(j)

     CMT(i) = valor_2_antigo
     CMT(j) = valor_1_antigo

     valor_1_antigo = id(i)
     valor_2_antigo = id(j)

     id(i) = valor_2_antigo
     id(j) = valor_1_antigo

     valor_1_antigo = title(i)
     valor_2_antigo = title(j)

     title(i) = valor_2_antigo
     title(j) = valor_1_antigo


 end Function
728x90
반응형

'back-end > ASP & PHP' 카테고리의 다른 글

[PHP] 유용한 코드2  (0) 2023.06.19
[PHP] 유용한 코드1  (0) 2023.06.19
[ASP] 글자수 제한 .... 붙여리턴  (0) 2023.06.19
[ASP] 날짜/주/월 더한 날 구하기  (0) 2023.06.19
[ASP] 랜덤값 생성  (0) 2023.06.19

+ Recent posts