3.7 高次方数的尾数
#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); }