多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
swapValue交换两数; ``` #include "pch.h" #include <iostream> //用std::cout << 则必须有: iostream #include<iomanip> //用printf( 则iomanip或iostream任选其一 //using namespace std; template <typename Type_of_Variable> //也可以写为: //template <class Type_of_Variable> void swapValue(Type_of_Variable &a, Type_of_Variable &b)// { Type_of_Variable tmp; tmp = a; a = b; b = tmp; }// int main() { // std::cout << "Hello World!\n"; float a1 = 12.3; float b2 = 45.7; swapValue( a1, b2); printf("a=%f", a1); printf(" ,b=%f\r\n", b2); std::cout << "a;" << std::setprecision(19)<< a1 << std::endl; using namespace std; // std:: cout << "b:" <<setw(9)<< b2 << std::endl; // }// // 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 // 调试程序: F5 或调试 >“开始调试”菜单 // 入门提示: // 1. 使用解决方案资源管理器窗口添加/管理文件 ```