Home > Back-end >  Why two for statement, as a result, the return 3221225725?
Why two for statement, as a result, the return 3221225725?

Time:11-24

Freshman to learn c + +, input number n, and n, maximum output and maximum subscript, if have the same maximum output grew up subscript
In the first output after the for statement is to output the maximum;
In the second for statement (want to find a subscript), directly back to 3221225725 when I was testing the
 # include 
using namespace std;
Int main () {
int n;
Int a [n].
Cout<& lt;" Input n=";
Cin> n;
for(int i=0; iCout<& lt;" Input a [" & lt; & lt; i<& lt; "]=";
Cin> A, [I].
}
Int Max=a, [0].
for(int i=0; iIf (maxMax=a [I + 1);
}
}
Coutfor(int i=0; iIf (Max==a [I])
Cout<& lt;" "& lt; }
return 0;
}
  • Related