题解 | #取近似值#
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
#include <stdio.h> int main() { float a; scanf("%f", &a); int b = a * 100; if (b % 100 >= 50) b = ((b + 50) / 100); else b /= 100; printf("%d", b); return 0; }
取近似值
https://www.nowcoder.com/practice/3ab09737afb645cc82c35d56a5ce802a
#include <stdio.h> int main() { float a; scanf("%f", &a); int b = a * 100; if (b % 100 >= 50) b = ((b + 50) / 100); else b /= 100; printf("%d", b); return 0; }
相关推荐