?? noswap.cpp
字號:
// incorrect swap method
#include<iostream>
using namespace std;
void swap(int x, int y)
{// swap the integers x and y
int temp = x;
x = y;
y = temp;
}
// test the swap function
int main()
{
int a = 2;
int b = 3;
// output the values
cout << "Before swapping, a = " << a << " b = " << b << endl;
// swap a and b
swap(a,b);
// output the new values
cout << "After swapping, a = " << a << " b = " << b << endl;
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -