標題:
二數中找出較大的數
[打印本頁]
作者:
tonyh
時間:
2013-11-23 16:56
標題:
二數中找出較大的數
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int a, b, c;
cout<<"請輸入第一個數: ";
cin >> a;
cout<<"請輸入第二個數: ";
cin >> b;
c=(a>b)?a:b;
cout<<"兩數中較大的數為: "<<c<<endl;
system ("pause");
return 0;
}
複製代碼
作者:
施伯叡
時間:
2013-11-23 16:57
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int a,b,c;
cout<<"請輸入第一個數:";
cin>>a;
cout<<"請輸入第二個數:";
cin>>b;
c=(a>b)?a:b;
cout<<"兩數中較大的數為:"<<c<<endl;
system ("pause");
return 0;
}
複製代碼
作者:
張峻瑋
時間:
2013-11-23 16:58
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a,b,c;
cout<<"請輸入第一個數:";
cin>>a;
cout<<"請輸入第二個數:";
cin>>b;
c=(a>b)?a:b;
cout<<"兩數中較大的數為"<<c<<endl;
system("pause");
return 0;
}
複製代碼
作者:
張郁偵
時間:
2013-11-23 16:58
本帖最後由 張郁偵 於 2013-11-23 17:18 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a,b,c;
cout<<"請輸入第一個數:";
cin>>a;
cout<<"請輸入第二個數:";
cin>>b;
c=(a>b) ? a:b;
cout<<"兩數中教大的數為:"<<c<<endl;
system ("pause");
return 0;
}
複製代碼
[code]
作者:
周雍程
時間:
2013-11-23 16:59
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int a, b, c;
cout<<"請輸入第一個數:";
cin >> a;
cout<<"請輸入第二個數:";
cin >> b;
c=(a>b)?a:b;
cout<<"兩數中較大的數為:"<<c<<endl;
system("pause");
return 0;
}
複製代碼
作者:
張郁庭
時間:
2013-11-23 17:00
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int a, b, c;;
cout << "請輸入第一個數: ";
cin >> a;
cout << "請輸入第二個數: ";
cin >> b;
c=( a > b ) ? a : b;
cout<<"兩數中較大的數為: "<<c<<endl;
system ("pause");
return 0;
}
複製代碼
作者:
張彥承
時間:
2013-11-23 17:02
#include <iostream>
#include <cstdlib>
using namespace std;
int main ()
{
int a,b,c;
cout<<"please enter the first number:"<<endl;
cin>>a;
cout<<"please enter the second number:"<<endl;
cin>>b;
c=(a>b)?a:b;
cout<<"THE BIGGEST OF TWO:"<<c<<endl;
system ("pause");
return 0;
}
複製代碼
作者:
劉得旗
時間:
2013-11-23 17:03
#include <iostream>
#include<cstdlib>
using namespace std;
int main( )
{
int a, b, c;
cout<<"輸入第1個數:";
cin>>a;
cout<<"輸入第2個數:";
cin>>b;
c=(a>b)?a:b;
cout<<"最大的數是:"<<c<<endl;
system("pause");
return 0;
}
複製代碼
作者:
張彥承
時間:
2013-11-23 17:16
#include <iostream>
#include <cstdlib>
using namespace std;
int main ()
{
int a,b,c,d,e;
cout<<"please enter the first number:"<<endl;
cin>>a;
cout<<"please enter the second number:"<<endl;
cin>>b;
cout<<"please enter the third number:"<<endl;
cin>>c;
d=(a>b)?a:b;
e=(d>c)?d:c;
cout<<"THE BIGGEST OF three:"<<e<<endl;
system ("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2