/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
//**********************
// ้ซไบ้ฒ้็จๅผ่จญ่จ *
// ๅคงๆจ้็จๅผ้็ผ *
// 205-xx-XXX *
// <ๅ
ญๅๆธๅญ็ๆๅบ> *
//**********************
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <algorithm>
using namespace std;
int main()
{
// ๅฎฃๅ้ฃๅ
const int SIZE = 6;
int result[SIZE];
// ้จๆฉๆธ็ๆ
srand(time(NULL));
for (int i = 0; i < SIZE; i++) {
result[i] = rand() % 49 + 1;
}
// ้กฏ็คบๆๅบๅ็้ฃๅ
cout << "ๆๅบๅ: ";
for (int i = 0; i < SIZE; i++) {
cout << result[i] << " ";
}
cout << endl;
// ๆๅบ
sort(result, result + SIZE);
// ้กฏ็คบๆๅบๅพ็้ฃๅ
cout << "ๆๅบๅพ: ";
for (int i = 0; i < SIZE; i++) {
cout << result[i] << " ";
}
cout << endl;
return 0;
}