#include<stdio.h>
/*
int max(int x , int y , int z)
{
if(x > y && x > z) return x;
else if( y > x && y > z) return y ;
else return z;
}
int main(void)
{
int x1,x2,x3, t = 1 , i , flag,x0;
printf("Input 3 number :\n");
scanf("%d",&x1);
scanf("%d",&x2);
scanf("%d",&x3);
x0 = max(x1 ,x2 ,x3);
for( i = 2 ; i <= x0 ; i++)
{
flag = 1;
while(flag)
{
flag = 0;
if(x1 % i == 0)
{
x1 = x1/i;
flag = 1;
}
if(x2 % i == 0)
{
x2 = x2/i;
flag = 1;
}
if(x3 % i == 0)
{
x3 = x3/i;
flag = 1;
}
if(flag == 1)
{
t = t*i;
}
}
x0 = max(x1 ,x2 ,x3);
}
printf("\n%d\n",t);
return 0 ;
}
*/
int main(void)
{
int a = 1 ;
int b = 0 ;
int c = 5 ;
int d = 70*a + 21*b + 15*c ;
while( d > 105 )
{
d = d-105;
}
printf("%d\n",d);
return 0;
}
最小公倍数问题 算法设计
最新推荐文章于 2021-01-27 22:58:05 发布