int a[10];
for (int i = 0; i < 10; i++)
{
cout << "Enter Input a#" << i + 1 << " : ";
cin >> a[i];
}
for (int j = 0; j < 10; j++)
{
for (int i = 0; i < 9; i++)
{
if (a[i] > a[i + 1])
{
int temp;
temp = a[i];
a[i] = a[i + 1];
a[i + 1] = temp;
}
}
}
for (int i = 0; i < 10; i++)
{
cout << a[i] << endl;
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น