This is the code, but the output of two sets of data, output all the answer to the first group, Behind a sample, I hope my friends can help me, thank you!
This code, but the output is wrong,
#include #include #include Struct sb { Int num1 [3]. Int num2 [3]. } hx [3]. Int main () { Int the cas (int a [], int [] b); Int n, I, k, * u * o; Int the SBS; The scanf (" % d ", & amp; N); for(i=0; I & lt; n; I++) { For (k=0; K & lt; 3; K++) { The scanf (" % d % d ", & amp; Hx [I] num1 [k], & amp; Hx [I] num2 [k]); } U=hx [0]. Num1; O=hx [0]. Num2; The SBS=cas (u, o); Printf (" % d \ n ", the SBS); } return 0; } Int the cas (int a [], int [] b) { Int I, * j * h; J=a; H=b; for(i=0; I & lt; 1000; I++) { If ((I * j * h==%) & amp; & (I % * (j + 1)==* (h + 1)) & amp; & (I % * (j + 2)==* (h + 2))) { break; } } Return the I; }
Huaian folklore with a story, "han xin point soldier", the second a idiom "han xin point soldier, the more the better," han xin with 1500 soldiers in battle, killed five centuries, stood a row of three people, more than 2 people; Stood a row of 5 people, more than four people; Station 7, 6 people, the more the han xin right number: 1049, if I give you some conditions, could you help me to meet the conditions of the smallest positive integer? , of course, the problem is simple, give you each group of data line has three Numbers, Numbers in each row of the first number is the divisor d, the second number is the remainder m, then please work out a minimal positive integer n (n & lt; 1000000), the n can satisfy the three lines of figures at the same time n/d==x... M.
Input
The first line is the number of sets of data nCase (n<=5), the following three ncase lines, each three lines is a set of data that is to give you three sets of data,
The Output
For each group of input, output a line, is obtained by the least positive integer,