📜  二维数组 A[N,M],随机数从 10 到 90. - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:46.629000             🧑  作者: Mango

代码示例1
#include 
#include  // For time()
#include   // For srand() and rand() 
#include 
using namespace std;
 int table[5][10];
void sortarray (int[], int);
void showarray (int[], int);

int main()
{
    const int row=5;
    const int column=10;
    int table[row][column];
    int rnum;
    int t[row];
    
    srand(time(0));  // Initialize random number generator. 
    rnum = (rand() % 100) + 1;    
    


    for(int r=0; r t[count +1])
            { 
                 temp = t[count];
                t[count]=t[count +1];
                t[count +1]= temp;
                swap=true;
            }
        }
    }while (swap);
}





void showarray (int t[], int elems)
{
    for (ount] << " ";
    cout << endl;int count=0; count < elems; count++)
        cout << t[c
}