前五道思考题:
补充:
Temp=x*y*z
Temp_1=(y*z*i)当Temp_1%x==a
Temp_2=(x*z*i)当Temp_2%y==b
Temp_3=(y*x*i)当Temp_3%z==c
Num=Temp_1+Temp_2+Temp_3当Num<temp;
#include<stdio.h>
void func(int x,int a,int y,int b,int z,int c)
{
int temp = x * y * z,temp1=0;
int temp_1=0, temp_2=0, temp_3=0;
int i=1;
while(temp_3 % z != c)
{
temp_3 = x * y * i;
i++;
}
i = 1;
while (temp_2 % y != b)
{
temp_2 = x * z * i;
i++;
}
i = 1;
while (temp_1 % x != a)
{
temp_1 = z * y * i;
i++;
}
temp1 = temp_1 + temp_2 + temp_3;
while (temp1 - temp > 0)
{
temp1 -= temp;
}
printf("%d", temp1);
}
int main()
{
int x, y, z, a, b, c;
scanf("%d%d%d%d%d%d", &x, &a, &y, &b, &z, &c);
func(x, a, y, b, z, c);
}