地址:http://acm.nyist.net/JudgeOnline/problem.php?pid=473

 1 #include <stdio.h>
 2 int main()
 3 {
 4   int a,b;
 5   int i;
 6   while(scanf("%d%d",&a,&b)!=EOF)
 7   {
 8     if(b==0)
 9       printf("1\n");
10     else 
11     {
12       a%=10;
13       b=b%4+4;
14       int s=a;
15       for(i=1;i<b;i++)
16       s*=a;
17       s%=10;
18       printf("%d\n",s);
19     }
20   }
21 return 0;
22 }

相关文章:

  • 2021-09-09
  • 2021-10-12
  • 2022-12-23
  • 2022-03-02
  • 2022-12-23
猜你喜欢
  • 2022-03-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-19
  • 2021-09-26
相关资源
相似解决方案