杭电1061
#include <stdio.h>int main (void){int T,n,i,k;scanf("%d",&T);while(T--){scanf("%d",&n);if(n>4)if(n%4!=0) i=n%4;else i=4;elsei=n;for(k=n%10,n%=10;i>1;i--)k=k*n%10;printf("%d\n",k);}return 0;}
补充:软件开发 , C++ ,
#include <stdio.h>int main (void){int T,n,i,k;scanf("%d",&T);while(T--){scanf("%d",&n);if(n>4)if(n%4!=0) i=n%4;else i=4;elsei=n;for(k=n%10,n%=10;i>1;i--)k=k*n%10;printf("%d\n",k);}return 0;}
补充:软件开发 , C++ ,