I really don't know why, all of my words have changed, but it is the macro poison of Word. But why is it infected? This is really strange, I have not used macro. Forget it, there is no time to pay now, I have to hurry to write this tutorial diary.
Today's curriculum is finally focusing, it is the algorithm, because only start, first start from an easy sorting algorithm, copy a topic, let us do, as follows:
There is already a sorted array, and you will enter a number in the original sort rules.
I saw this topic, I feel that I am more sure, I have written it out, but who knows that my program has a dead place, just gave the teacher to see it, but I finished my mistake. It's really bad, since all wrong, write down the answer I do, but let everyone compare.
#define n 8
Main ()
{
INT A [N];
INT I, J, T, S;
For (i = 1; i <= 7; i )
a [i-1] = i * 10;
For (i = 0; i <7; I -)
IF (a [i]
{s = a [i]; a [i] = a [i 1]; A [i 1] = s;} For (i = 0; i <7; i ) Printf ("% D, A [i]); } It seems really right, there is no mistake, maybe it is not careful. The teacher is that this kind of skill can be seen, let me slowly come to my mistake, in fact, it is wrong to finally don't assign an element, because there is no initial pass value, the number of random builds may be large, or may be very Less, but if you just smaller than the plug, it is no longer correct. Ok, I said my mistake, let us see a correct program. #define n 8 Main () { INT A [n] = {20, 30, 40, 50, 60, 70, 80}; INT N, I; For (i = 8; I> = 0; I -) {