Home > Back-end >  Structures in the array pointer
Structures in the array pointer

Time:06-04

/* this is the code, the following questions, ask bosses analysis analysis where there is error, thank you */

# include
# include
# include
Struct sb
{
Int num1 [3].
Int num2 [3].
} hx [5].
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 [k]. Num1, & amp; Hx [k]. Num2);
}
U=& amp; Hx [0]. Num1; O=& amp; Hx [0]. Num2;
The SBS=cas (u, o);
Printf (" % d ", SBS);
}
return 0;
}
Int the cas (int a [], int [] b)
{
Int I, k, p, * j * h.
J=a; H=b;
for(i=0; ; I++)
{
For (k=0; ; K++)
{
For (p=0; ; P++)
{
If (I % * j==* h& & K % (* j + 1)==(* h + 1) & amp; & P==% j + 2 (*) (* h + 2))
{
If (I==* j& & *==j * h)
{
Return * j;
}
}
}
}
}
}

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,

The Sample Input
2
3 2
5 4
7 (6)
9 2
7 3
6 5
The Sample Output
104
101

CodePudding user response:

Bosses, please answer!!!!!!!!!!!!!!

CodePudding user response:

Num1 num2 is an array, do not need to take the address, is & amp; symbol

CodePudding user response:

refer to the second floor SuperDay response:
num1 num2 is an array, do not need to take the address, is & amp; The symbols

Bosses, not changed, still as

CodePudding user response:

Don't call bosses, of the word is very bad feeling, in addition, to learn how to ask questions, have error phenomenon, please accurately describe the problem

CodePudding user response:

 # include 
# include
# include
Struct sb
{
Int num1 [3].
Int num2 [3].
} hx [5].
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 [k]. Num1, & amp; Hx [k]. Num2);
The scanf (" % d % d ", & amp; Hx [I] num1 [k], & amp; Hx [I] num2 [k]);
}
//u=& amp; Hx [0]. Num1; O=& amp; Hx [0]. Num2;
U=hx [0]. Num1;
O=hx [0]. Num2;
The SBS=cas (u, o);
Printf (" % d ", SBS);
}
return 0;
}
Int the cas (int a [], int [] b)
{
Int I, k, p, * j * h.
J=a; H=b;
for(i=0; ; I++)
{
For (k=0; ; K++)
{
For (p=0; ; P++)
{
If (I % * j==* h& & K % (* j + 1)==(* h + 1) & amp; & P==% j + 2 (*) (* h + 2))
{
If (I==* j& & *==j * h)
{
Return * j;
}
}
}
}
}
}

For your reference ~

CodePudding user response:

reference 4 floor SuperDay response:
don't call, for the word, in addition, to learn how to ask questions, error has phenomenon, please accurately describe the problem

# 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)))
{
Return the I;
}
}
}

This code after being changed, but the output is wrong, I feel should be the inside of the function if wrong

CodePudding user response:

reference 5 building self-confidence boy reply:
 # include 
# include
# include
Struct sb
{
Int num1 [3].
Int num2 [3].
} hx [5].
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 [k]. Num1, & amp; Hx [k]. Num2);
The scanf (" % d % d ", & amp; Hx [I] num1 [k], & amp; Hx [I] num2 [k]);
}
//u=& amp; Hx [0]. Num1; O=& amp; Hx [0]. Num2;
U=hx [0]. Num1;
O=hx [0]. Num2;
The SBS=cas (u, o);
Printf (" % d ", SBS);
}
return 0;
}
Int the cas (int a [], int [] b)
{
Int I, k, p, * j * h.
J=a; H=b;
for(i=0; ; I++)
{
For (k=0; ; K++)
{
For (p=0; ; P++)
{
If (I % * j==* h& & K % (* j + 1)==(* h + 1) & amp; & nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related