Home > Back-end >  Great god tell me where is wrong??
Great god tell me where is wrong??

Time:09-26

Void maxmin (int a [], int m, int& Max, int& Min)
{Max=a, [0].
Min=a, [0].

for(int i=1; i{
If (a [I] & gt; Max)

Max=a, [I].

}

};

Int main ()
{
Int a, [1000].

int m;
Cin> m;
for(int i=0; i{
A [I]=m;
}

Max=maxmin (a, m, Max, min);
cout<& lt; Max<& lt; Min.


} */

CodePudding user response:

A pile of error

CodePudding user response:

1, Max=maxmin (a, m, Max, min); In front of the function is declared VOID type, returns the value of ha.
2, input may be more than 1000 m value, an array.
3, the input of m value is assigned to a array, all a [I] value for m, also determine what's the biggest, minimum? !

Look for some c + + books or video, children's shoes, you need to refuel,

CodePudding user response:

Not possible input YueJie, missed set min.

//m must & gt; 0
Void maxmin (int a [], int m, int& Max, int& Min)
{
Max=a, [0].
Min=a, [0].

for(int i=1; i{
If (a [I] & gt; Max)
Max=a, [I].
If (a [I] Min=a, [I].
}
};

CodePudding user response:

The key is the last at the end of the */this is a comment below! Have this, will quote a heap of fault
  • Related