//四舍五入的两种写法: cout << round(sum) << endl; cout << int(sum + 0.5) << endl; 其中,round函数头文件为#include<cmath> 问题来源: PAT1077