1
//編寫程序提示用戶輸入兩個數,然后報告哪個數比較小。
2
#include <iostream>
3
4
using std::cin;
5
using std::cout;
6
using std::endl;
7
8
int main()
9

{
10
cout << "Please enter two numbers:" << endl;
11
int a = 0,b = 0;
12
cin >> a;
13
cin >> b;
14
cout << "So,the number " << (a>b ? b : a)
15
<< " is smaller than " << (a>b ? a : b)
16
<< "." << endl;
17
return 0;
18
}
//編寫程序提示用戶輸入兩個數,然后報告哪個數比較小。2
#include <iostream>3

4
using std::cin;5
using std::cout;6
using std::endl;7

8
int main()9


{10
cout << "Please enter two numbers:" << endl;11
int a = 0,b = 0;12
cin >> a;13
cin >> b;14
cout << "So,the number " << (a>b ? b : a) 15
<< " is smaller than " << (a>b ? a : b) 16
<< "." << endl;17
return 0;18
}
