CodePudding user response:
Put a [j]=[9 - b I] the next row k++ to j++CodePudding user response:
Small white, you can refer to
# include
Int main ()
{
Const int length=9;
Int Numbers [length]={1, 2, 3, 4, 5, 6, 7, 8, 9};
For (int I=0; I & lt; 9. I++)
{
Printf (" % d ", Numbers [I]);
}
printf("\n");
Printf (" the number of times to move: ");
Int moveCounts;
Scanf_s (" % d ", & amp; MoveCounts);
Int temp.
For (int I=0; I & lt; MoveCounts; I++)
{
Temp=Numbers [length - 1);
For (int j=length - 1; J & gt; 0; J -)
{
Numbers [j]=Numbers [j - 1);
}
Numbers [0]=temp;
}
For (int I=0; I & lt; Length; I++)
{
Printf (" % d ", Numbers [I]);
}
return 0;
}
CodePudding user response:
Reference:# include
9 # define N
Int main ()
{
Int I, j, n, m;
,54,85,39,51,76,90,14,20 int a [N]={12};
Printf (" please enter to move: ");
The scanf (" % d ", & amp; N);
for(i=0; iFor (j=N - 1, m=a, [j]. J> 0; J -) {
A [j]=a, [1].
}
A [j]=m;
}
for(i=0; iPrintf (" % d ", a [I]);
}
printf("\n");
return 0;
}