【十二题解】 | #取近似值#
取近似值
http://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
这题是真没啥说的
#include<stdio.h>
int main(){
float number ;
scanf("%f", &number);
int num = (int)number;
float remander = number - num;
if(remander >= 0.5){
printf("%d", num+1);
}
else{
printf("%d", num);
}
return 0;
}