用时10分钟,一开始忘记保存小数点后两位了
#include<iostream>
#include<iomanip>
using namespace std;
double add(double n1,double n2)
{
return n1+n2;
}
int main()
{
// freopen("xxx.in","r",stdin);
// freopen("yyy.out","w",stdout);
double n1,n2;
cin >> n1 >> n2;
double j=add(n1,n2);
cout << fixed << setprecision(2) << j;
// fclose(stdin);
// fclose(stdout);
return 0;
}