Created
August 27, 2014 17:46
-
-
Save owner0220/354e104cd29af6be406b to your computer and use it in GitHub Desktop.
문제로 풀어보는 알고리즘
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| //두 변수값을 주소를 받아 변경하기 | |
| void swap(int *a, int *b) | |
| { | |
| int tmp; | |
| tmp=*a; | |
| *a=*b; | |
| *b=tmp; | |
| } | |
| //배열의 두원소 바꾸기 | |
| void swap_arr(int a[], int i, int j) | |
| { | |
| int tmp; | |
| tmp=arr[i]; | |
| arr[i]=arr[j]; | |
| arr[j]=tmp; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment