#include <stdio.h> int main (){ int i, x,y, last=1; /★变量last保存求得的×的y次方的部分积的后三位*/ printf("Input x and y:An") ; scanf("%d Sd",&x, &y); for(i-1;i<=y;i++) /*×自乘的次数y*/ last=last*x%1000;/*将last乘x后对1000取模,即求积的后三位*/printf ("The last three digits is:%dn",last); }
标签:尾数,last,int,3.7,次方,main From: https://www.cnblogs.com/xuan-2004/p/17419195.html