swapmain.pgm

来自「《C++ Primer》第四版题解及头文件」· PGM 代码 · 共 20 行

PGM
20
字号
#include <iostream>

using std::cout;
using std::endl;

int main() 
{
    int i = 10;
    int j = 20;

    cout << "Before swap():\ti: "
         << i << "\tj: " << j << endl;

    swap(i, j);

    cout << "After  swap():\ti: "
         << i << "\tj: " << j << endl;
    return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?