#include
# include "stdio.h"
using namespace std;
Void firststep ()
{
//input matrix
Int hang=0, lie=0, hangam=0, lieam=0;
Cout & lt; <"Please input rows and columns of the matrix (100)" & lt;
Int num [100] [100].//!
Cout & lt; <"Please input in sequence" & lt;
{
For (int lie=0; Lie & lt; Lieam; Lie++)
{
Cin & gt;> Num [hang] [lie];
}
}
//print matrix
Cout & lt; <"You input matrix is:" & lt;
{
For (int lie=0; Lie & lt; Lieam; Lie++)
{
Cout & lt;
Cout & lt;
Short press;
Cout & lt; <"If the input is correct, please press 0" & lt;
If (press==1)
{
Firststep ();
}
The else {cout & lt;
Int main ()
{
Int hang=0, lie=0, hangam=0, lieam=0;
Int num [100] [100].
Firststep ();
//input ordinal
Int ordinal=0;
Cout & lt; <"Looking for which large elements & lt;"
Cout
//into a one dimensional array
Int [10000] b={0};
Int * p=b;
Int len=hangam * lieam;
For (int I=0; I & lt; Hangam; I++)
{
For (int j=0; J & lt; Lieam; J++)
{
* (p + (I + j * lieam))=num [I] [j];
}
}
//
For (int k=0; K & lt; Len - 1; K++)
{
For (int h=0; H & lt; Len - k - 1; H++)
{
If (b [h] {
Int temp=b [h];
B=b [h] [h + 1);
B [h + 1)=temp;
}
}
}
Cout & lt; <"The first" & lt;
return 0;
};
CodePudding user response:
Oh, I realized, after the local variable in a function to use will be released, so this time is not the value of num, b