swapmain.pgm
资源名称:CppPrimer.rar [点击查看]
上传用户:qdkongtiao
上传日期:2022-06-29
资源大小:356k
文件大小:0k
源码类别:
书籍源码
开发平台:
Visual C++
- #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;
- }