坎儿妹问我这个……我一看,太简单了,写出来吧 gave a and b,how to know the a^b's the last digit number void main() { const int n[10][4] = { { 0, 0, 0, 0 }, { 1, 1, 1, 1 }, { 6, 2, 4, 8 }, { 1, 3, 9, 7 }, { 6, 4, 6, 4 }, { 5, 5, 5, 5 }, { 6, 6, 6, 6 }, { 1, 7, 9, 3 }, { 6, 8, 4, 2 }, { 1, 9, 1, 9 } }; int a, b; scanf ( "%d %d", &a, &b ); a = a % 10; b = b % 4; printf ( "%d/n", n[a][b] ); system("pause"); }