Int main ()
{
Int a, [10].
int i;
Void func1 (int a []);
The scanf (" % d, % d, % d, % d, % d, % d, % d, % d, % d ", & amp; A [0], & amp; A [1], & amp; A [2], & amp; A [3], & amp; A [4], & amp; A [5], & amp; A [6], & amp; A [7], & amp; A [8]);
The scanf (" % d ", & amp; A [I]);
Func1 (a);
for(i=0; i<10; I++)
Printf (" % d ", a [I]);
printf("\n");
return 0;
}
Void func1 (int a [])
{
Int I, t, j;
for(i=0; i<10; I++)
for(j=0; j<10; J++)
If (a [I] {
T=a [I];
A [I]=a, [j].
A [j]=t;
}
}
The program compiled without problem, not a run, I don't know what is the problem, and a great god solve
CodePudding user response:
int I;//here I no initialization, is a random number theThe scanf (" % d, % d, % d, % d, % d, % d, % d, % d, % d ", & amp; A [0], & amp; A [1], & amp; A [2], & amp; A [3], & amp; A [4], & amp; A [5], & amp; A [6], & amp; A [7], & amp; A [8]);
The scanf (" % d ", & amp; a, [I] ).//here I don't know where the data to read, there should be a & amp; A [9]
Is actually just took nine effective digital input; The tenth is unknown input results
The sorting result is unknown
CodePudding user response:
The scanf (" % d, % d, % d, % d, % d, % d, % d, % d, % d ", & amp; A [0], & amp; A [1], & amp; A [2], & amp; A [3], & amp; A [4], & amp; A [5], & amp; A [6], & amp; A [7], & amp; A [8]);The scanf (" % d ", & amp; A [I]);
These lines look very afflictive
for (i=0; i<10; I++)
{
The scanf (" % d ", & amp; A [I]);
}
This assignment
CodePudding user response:
Fun