WithCS
Toggle navigation
Practice
Status
Discuss
Challenge
Login
Register
Discuss
4368
질문입니다..
질문입니다..
yih9329
Reply 9 years 6 weeks ago
먼저입력한 순서대로도 나오는데 어느 부분이 틀린건가요?? ......................................................
Status
Problem
withcs1
Reply 9 years 6 weeks ago
for(int i=0; i<n; i++) { for(int j=i+1; j<n; j++) { if(sum[i]<sum[j]) { String tmp[]; int temp; tmp=arr[i]; arr[i]=arr[j]; arr[j]=tmp; temp=sum[i]; sum[i]=sum[j]; sum[j]=temp; } } } 0 10 2 20 1 10 1 10 2 20 -> 0 10