hdu 1061 位
对这道题不想说什么,写的代码一直超时,
原来是有规律的,既然错了,就记下来,给自己一个警醒吧
题目 转用ac代码
#include <stdio.h> int main() { int t,n,table[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}}; scanf("%d",&t); while (t--) { scanf("%d",&n); printf("%d\n",table[n%10][n%4]); } return 0; }