▼ กำลังโหลดข้อมูล... ▼
แสดงความคิดเห็น
คุณสามารถแสดงความคิดเห็นกับกระทู้นี้ได้ด้วยการเข้าสู่ระบบ
กระทู้ที่คุณอาจสนใจ
อ่านกระทู้อื่นที่พูดคุยเกี่ยวกับ
การพัฒนาซอฟต์แวร์
วิทยาศาสตร์คอมพิวเตอร์
การออกแบบฐานข้อมูล
วิศวกรรมคอมพิวเตอร์
การพัฒนา Desktop Application
ช่วยเขียนโปรแกรม C++ เรียงค่ามากไปน้อย 5 หลักทีครับ
#include <iostream>
using namespace std;
int main()
{
int int_n1,int_n2,int_n3;
cout << "Enter Number 1 : ";
cin >> int_n1;
cout << "Enter Number 2 : ";
cin >> int_n2;
cout << "Enter Number 3 : ";
cin >> int_n3;
if (int_n1 > int_n2)
{
if (int_n2 > int_n3)
{
cout << int_n1 << " " << int_n2 << " " << int_n3;
}
else
{
if (int_n1 > int_n3)
{
cout << int_n1 << " " << int_n3 << " " << int_n2;
}
else
{
cout << int_n3 << " " << int_n1 << " " << int_n2;
}
}
}
else
{
if (int_n1 > int_n3)
{
cout << int_n2 << " " << int_n1 << " " << int_n3;
}
else
{
if (int_n2 > int_n3)
{
cout << int_n2 << " " << int_n3 << " " << int_n1;
}
else
{
cout << int_n3 << " " << int_n2 << " " << int_n1;
}
}
}
cout << endl;
system("pause");
}
มันรันได้แค่ 3 หลัก แต่อยากได้ 5 หลัก รบกวนช่วยหน่อยครับ ขอความช่วยเหลือจากคนทำเป็น ขอบคุณมากๆครับ