#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void swap(int &n,int &m){
int temp;
temp=n;
n=m;
m=temp;
};
int main(int argc, char** argv) {
int a =1;
int b= 10;
cout<< "a 반지름 : " << a;
cout<< "b 반지름 : " << b;
cout <<"swap 후 ";
swap(a,b);
cout<< "a 반지름 : " << a;
cout<< "b 반지름 : " << b;
return 0;
}
'언어 > C++' 카테고리의 다른 글
5장 4번- Ogdol -> Okdol 단어 알파벳 바꾸기 (0) | 2019.11.22 |
---|---|
5장 2번- 더 큰 수 비교하기 (참조 매개변수) (0) | 2019.11.21 |
4장 10번 - 문장 알파벳 히스토그램 만들기 (0) | 2019.11.21 |
4장 9번 - 원의 최소면적에 따라 원 분류 (0) | 2019.11.21 |
4장 7번 -이름으로 전화번호 검색하기 (0) | 2019.11.21 |