Home > Back-end >  I this what wrong
I this what wrong

Time:10-02

#include
using namespace std;
Int main ()
{
Int I, n,
Int Max=9999;
Int min=- 9999;
Int a, [100].
N=100;
For (I=0; I & gt; n; I++)
{
If (a [I] & gt; Max) Max=a [I];
If (a [I] }

Cout & lt; Cout & lt;

}

CodePudding user response:

i> N is stem what of

CodePudding user response:

Don't know what you want to achieve function

Seems wrong many

Line 5 semicolon

It does not perform

CodePudding user response:

i> N is? And min is set to 0

CodePudding user response:

Int I, n,
Max=9999,
Min=9999,
A [100],
N=100;
Or
Int I, n;
Int Max=9999;
Int min=- 9999;
Int a, [100].
Int n=100;
In addition
Int Max=0;
Int min=0;
So as to fully show the size of an array of uninitialized

CodePudding user response:

 int a [],5,6,8,10000} {- 1000; 
Int Max=a, [0].
Int min=a, [0].
For (int I=1; I & lt; Sizeof (a)/sizeof (int); I++)
{
If (a [I] & gt; Max)
{
Max=a, [I].
}
Else if (a [I] {
Min=a, [I].
}
The else
continue;
}

CodePudding user response:

Initial value should not be set to the Max, min, 9999, or 9999
If your array no bigger than 9999 the number of inside, then your Max is always 9999,
In the same way with - 9999 to calculate the minimum number
In the same way with 0 is the largest number
In the same way with 0 to calculate the minimum number of,
  • Related