Home > Back-end >  Teach anyone who ace to give advice or comments, I don't think for a few hours all want to come
Teach anyone who ace to give advice or comments, I don't think for a few hours all want to come

Time:10-24

(1) the elements in the array is a diminishing value than orderly, input from the keyboard x, insert x to a of the array, the array after insert a element is still orderly, (for example: in the array bb [N]=,23,31,44,51,63,71,79,85,95 {12} 93, insert the results for the bb [N]=,23,31,44,51,63,71,79,85,93,95 {12})
Please fill in the underline of the program with the right content and remove the underline, make the program correct results,
Note: may not add or delete lines, the structure of the are not allowed to change!
Program listing:
# include & lt; Stdio. H>
# define N 10
Void main ()
{int I, j, n.
12,33,31,44,51,63,71,79,85,95 intbb [N + 1)={};
Printf (" input n \ n \ n "); The scanf (" % d ", & amp; N);
Printf (" \ n \ n * * * * * * the original list ");
for(i=0; ifor(i=0; iIf (n/* * * * * * * * * * * * * * * found * * * * * * * * * * * * * * */
{the for (j=N; (1); J -)
/* * * * * * * * * * * * * * * found * * * * * * * * * * * * * * */
(2)
Bb [I]=n;
/* * * * * * * * * * * * * * * found * * * * * * * * * * * * * * */
(3)
}
If (I==N) bb [I]=N;
Printf (" \ n \ n newllist * * * * * * ");
/* * * * * * * * * * * * * * * found * * * * * * * * * * * * * * */
for(i=0; i<(4); I++)
Printf (" % 5 d, bb [I]);
}

CodePudding user response:

The first empty: j> i;
The second empty: int temp=bb [I];
The third empty: bb [I + 1)=temp;
The fourth is empty: N + 1;

CodePudding user response:

Make up, you where is the program to the title of the building Lord, doesn't even have the indentation, be warned, if (I==N) bb [I]=N; This line must be placed on the for (I=0; i CodePudding user response:

Programmers exam questions
  • Related