#include <iostream>
#include <algorithm>
using namespace std;
int main( )
{
int a = 10;
int b = 5;
std::swap( a, b );
cout << "a = " << a << ", b = " << b << endl;
}
C++标准库函数swap的用法
最新推荐文章于 2024-08-05 14:31:08 发布
#include <iostream>
#include <algorithm>
using namespace std;
int main( )
{
int a = 10;
int b = 5;
std::swap( a, b );
cout << "a = " << a << ", b = " << b << endl;
}