U E D R , A S I H C RSS

데블스캠프2006/화요일/pointer/문제1/윤성준

윤성준

~cpp

#include <iostream>

using namespace std;

void swap(int *n, int *i);

void main()
{
	int a, b;
	a = 1, b = 18;
	cout << a << " " << b << endl;

	swap(a, b);

	cout << a << " " << b << endl;
}

void swap(int *n, int *i)
{
	int m;

	m = *n;
	*i = *n;
	*n = m;
	
}

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:06
Processing time 0.0124 sec