#include<iostream>
using namespace std;
int main()
{
float a;
cin>>a;
int c=(int)a;
float d=a-c;
if(d<0.5)
cout<<c<<endl;
else if(d>=0.5)
cout<<(c+1)<<endl;
else
cout<<"THE ERROR!"<<endl;
}
【c++程序】取一个数的近似值
最新推荐文章于 2021-11-08 06:54:36 发布