#include <stdio.h> int main() { float a = 0.0f; scanf("%f", &a); printf("%.0f", a); return 0; }
第二种方法是通过其本身的进制来解决,会更加简洁。