5.18

#include<stdio.h>
main(){
int i,x,y,last=1;
printf("Input x and y:\n");
scanf("%d %d",&x,&y);
for(i=1;i<=y;i++)
last=last*x%1000;
printf("The last three digits is:%d\n",last);
}

posted @ 2023-05-18 19:01  孙锺鸣  阅读(8)  评论(0编辑  收藏  举报