题目思路
直接输出两个数相加保留 位即可。
代码
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long ll;
const int N=1e8+10;
int d;
double a,b;//因为要保留小数所以用浮点型
int main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
cin>>d>>a>>b;
cout<<fixed<<setprecision(d)<<a+b;//作用是保留n位小数,括号内填保留的尾数
return 0;
}