任意次方后的最后三位数

来源:互联网 发布:交换机telnet端口 编辑:程序博客网 时间:2024/05/17 22:30
#include <stdio.h>int main (){int i,x,y,z=1;printf ("please input two number x and y(x^y):\n");scanf ("%d%d",&x,&y);for (i=1;i<=y;i++)z=z*x%1000;printf ("the last digits of %d^%d is:%d\n",x,y,z);printf ("\n");return 0;}


                                             
0 0