为什么是0分啊
查看原帖
为什么是0分啊
1022606
sunweimu楼主2024/2/23 20:23
#include <bits/stdc++.h>
using namespace std;

int main(void)
{
	ios::sync_with_stdio(0);
	double n,s;
	cin>>n;
	s=n;
	for(int i=1;i<=10;i++)
	{
		n/=2;
		s+=n*2;
	}
	cout<<fixed<<setprecision(4)<<s<<endl<<fixed<<setprecision(7)<<n;
	return 0;
}

为什么不能四舍五入
2024/2/23 20:23
加载中...