#include <stdio.h> #include <math.h> int main() { int a ; scanf("%d",&a); int b = sqrt(a * a); printf("%d\n",b%10); }
需要考虑负数的情况,开根号保证是正数在对其取模