#include <stdio.h> int main() { float a = 0.0f; scanf("%f",&a); printf("%d",(int)a % 10); return 0; }
关键在于强制类型转换