题解 | #取近似值#
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
#include<stdio.h> int main() { float i =0; scanf("%f",&i); int j = i; printf("%d",(i-j)>=0.5?(int)(i+1):j); }
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
#include<stdio.h> int main() { float i =0; scanf("%f",&i); int j = i; printf("%d",(i-j)>=0.5?(int)(i+1):j); }
相关推荐