最简单的问题与算法(求最大约数)

来源:互联网 发布:2016小米抢购软件 编辑:程序博客网 时间:2024/05/20 13:18
/**************************************** *  File Name  : problem.c *  Creat Data : 2015.1.23*  Author     : ZY *****************************************/ /*最简单的问题与算法*//*求最大约数问555555的约数中最大的三位数是多少?*/#include <stdio.h>#define N 555555int main(){int j;for( j = 999 ;j > 99 ;j-- ){if( 0 == N%j ){printf("The max factor with 3 digits in %ld is: %d.\n",N,j);break;}}return 0;}

0 0
原创粉丝点击