Home > Back-end >  The problem of an insert data
The problem of an insert data

Time:09-25

# include
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 the
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] ).//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
reference 1 floor response:
int I;//here I no initialization, is a random number the
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] ).//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

Thank you very much! The problem is resolved,

CodePudding user response:

refer to the second floor CHXCHXKKK 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]);
}
Such assignment

This assignment is to input data to use commas
  • Related