CodePudding user response:
This is the basic application of the array, first learned to write codeCodePudding user response:
int nums [10].
//then assignment
Int index=0, maxint=nums [0].
For (int x=1; X<10; X++) {
If (maxint & lt; Nums [x]) {
The index=x;
Maxint=nums [x];
}
}
//how to output, write their own
Maxint is maximum in the array; The index is the location of the maximum value appeared, starting from 0,
Array elements could be the same, the code above will only remember the maximum first appeared,
Words, such a simple job would not begin, this is the contemporary college students?