⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 noswap.cpp

📁 datastucutre and algorithms, application, in C
💻 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 + -