![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
#include int main()
{ long i; int j; printf("Please input number:");
scanf("%ld",&i);
for(j=999;j>=100;j—)
if(i%j==0)
{
printf("The max factor with 3 digits in %ld is:%d.\n",i,j);
break;
}
system("pause");
} //高位数字的3位公约数。
#include int main()
{ int x,y,i,last=1; printf("Input X and Y(X**Y):");
scanf("%d**%d",&x,&y);
for(i=1;i<=y;i++) last=last*x%1000;
printf("The last 3 digits of %d**%d is %d\n",x,y,last%1000); system("pause"); }
//高次方尾3位数(主要是last变量的变化)
下面这个好玩!~哈哈
用源代码改了下,变成可输入的
记住因子5这个数据
#include <stdio.h>
int main()
{
int a,count=0,x,temp; scanf("%d",&x);
for(a=5;a<=x;a+=5)
{
temp=a;
while(temp%5==0)count++,temp=temp/5;
}
printf("The number of 0 in the end of %d! is:%d",x,count);
system("pause");
}
//记录n!后面有多少个零,限制主要是x的大小