Home > Back-end >  C language array problem, bosses
C language array problem, bosses

Time:12-09

1 use the rand function to produce n integers between living [10], choose a prime number and press from small to large, the order of the output (n<15)
2 have eight elements of an array, the former three elements by moving the string to the three position, if the initial data is: 1 2 3 4 5 6 7 8 without increasing array, also does not increase the memory cell array, by moving the array element array change for: 4 5 6 7 8 1 2 3
3 in one of the array in ascending order to insert a number, and inserted after the array elements in ascending order, still known ascending array {1, 2, 4, 6, 8, 9, 12, 15, 149, 156},

Emmmmm didn't listen to in class is my fault, but is about to hand in your homework in the afternoon, hoping to help the bosses

CodePudding user response:

Try to write about, and will not be at all can't,

CodePudding user response:

reference 1/f, confident boy reply:
try to write about, will not be at all can't,

Himself wrote, to find the answer

CodePudding user response:

refer to the second floor Atanies response:
Quote: reference 1/f, confident boy reply:
try to write about, will not be at all can't,

Himself wrote, to find the answer from

Write your post, what's the problem? ~

CodePudding user response:

,,,,,,,,, me if I'm here to ask for the eldest brother,

CodePudding user response:

reference 4 floor Atanies response:
,,,,,,,,, me if I'm here to ask for the eldest brother,
you wrong code is one line of code you didn't post
MAO asked oh

CodePudding user response:

Questions are the big ye, the confident boy I think it is the best attitude

CodePudding user response:

. I just wanted to ask how to write the first program,,, is not a correction agghh

CodePudding user response:

Did you really too food, but also what also don't understand 23333

CodePudding user response:

Study together
 # include 
#include
Void ss (int a [100], int n)
{
int i,j;
for (i=0; iFor (j=2; J{
If (a [I] % j==0)
{
a[i]=0;
break;
}
}
}
Void px (int a [100], int n)
{
Int I, j, t;
for (i=0; iFor (j=I + 1; J{
If (a [I] & gt; A [j])
{
T=a [I];
A [I]=a, [j].
A [j]=t;
}
}
}
Int main ()
{
Int a [100], I=0, n);
Printf (" please enter an integer number: \ n ");
The scanf (" % d ", & amp; N);
for (i=0; iA [I]=rand () % 81 + 10;
Ss (a, n);
P (a, n);
for (i=0; i{
If (a [I]!=0)
Printf (" % d ", a [I]);
If ((I + 1) % 5==0 & amp; & A [I]!=0)
printf("\n");
}
}