题解 | #取近似值#
取近似值
http://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
#include<iostream>
using namespace std;
int main()
{
double d;
while(cin>>d)
{
printf("%d\n",(int)(d+0.5));
}
return 0;
}
取近似值
http://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
#include<iostream>
using namespace std;
int main()
{
double d;
while(cin>>d)
{
printf("%d\n",(int)(d+0.5));
}
return 0;
}
相关推荐