標題:
if 判斷式
[打印本頁]
作者:
游東祥
時間:
2015-1-31 11:15
標題:
if 判斷式
if 判斷式
作者:
黃璽安
時間:
2015-1-31 11:16
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a 大於 b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a 等於 b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
吳承勳
時間:
2015-1-31 11:17
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a 大於 b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a 等於 b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
翁證翔
時間:
2015-1-31 11:17
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入 a:";
cin>> a;
cout<<"請輸入 b:";
cin>> b;
cout<<"a=" <<a<<endl;
cout<<"b=" <<b<<endl;
if(a>b)
{
cout<<"a 大於 b"<<endl;
}
else if(a<b)
{
cout<<"a 小於 b"<<endl;
}
else
{
cout<<"a 等於 b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
陳鈺晟
時間:
2015-1-31 11:18
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a大於b"<<endl;
}
else if (a<b)
cout<<"a小於b"<<endl;
{
else
cout<<"a等於b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
趙弘揚
時間:
2015-1-31 11:18
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a 大於 b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a 等於 b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
許育樺
時間:
2015-1-31 11:19
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a大於b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a等於b"<<endl;
}
system("pause");
return 0;
複製代碼
作者:
吳翊民
時間:
2015-1-31 11:19
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a: ";
cin>>a;
cout<<"請輸入b: ";
cin>>b;
cout<<"a= "<<a<<endl;
cout<<"b= "<<b<<endl;
if(a>b)
{
cout<<"a大於b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a等於b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
許博竣
時間:
2015-1-31 11:20
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a大於b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a等於b"<<endl;
}
system("pause");
return 0;
複製代碼
作者:
沈子耕
時間:
2015-1-31 11:21
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
float x, y;
cout<<"請輸入X:";
cin>>x;
cout<<"請輸入y:";
cin>>y;
cout<<"x="<<x<<endl;
cout<<"y="<<y<<endl;
if(x>y)
{
cout<<x<<">"<<y<<endl;
}
else if(x<y)
{
cout<<x<<"<"<<y<<endl;
}
else
{
cout<<x<<"和"<<y<<"一樣大" <<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
陳彥彰
時間:
2015-1-31 11:22
#include<iosteam>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入 a;"
cin>> a;
cout<<"請輸入 b;"
cin>> b;
cout <<"a=" <<a<< endl;
cout <<"b=" <<b<< endl;
if (a>b)
{
cout<<"a 大於 b" << endl;
}
else if(a<b)
{
cout<<"a 小於 b" << endl;
}
else
{
cout<<"a等於"<<endl;
}
system("PAUSE")
return 0;
}
複製代碼
作者:
王翔
時間:
2015-1-31 11:22
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a 大於 b"<<endl;
}
else if (a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a 等於 b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
涂幸宸
時間:
2015-1-31 11:23
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
float a,b;
cout<<"請輸入a隊分數:";
cin>>a;
cout<<"請輸入b隊分數:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a隊獲勝"<<endl;
}
else if(a<b)
{
cout<<"b隊獲勝"<<endl;
}
else
{
cout<<"平手"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
許睿霖
時間:
2015-1-31 11:23
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a大於b"<<endl;
}
else if(a>b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a等於b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
施正心
時間:
2015-1-31 11:23
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a大於b";
}
else if(a<b)
{
cout<<"a小於b";
}
else
{
cout<<"a等於b";
}
cout<<endl;
system("pause");
return 0;
}
複製代碼
作者:
陳思惟
時間:
2015-1-31 11:25
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a大於b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a等於b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
朱霈芸
時間:
2015-1-31 11:25
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a 大於 b"<<endl;
}
else if(a<b)
{
cout<<"a 小於 b"<<endl;
}
else
{
cout<<"a 等於 b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
顏宇杰
時間:
2015-1-31 11:28
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a: ";
cin>> a;
cout<<"請輸入b: ";
cin>> b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a>b";
}
else if(a<b)
{
cout<<"a<b";
}
else
{
cout<<"a=b"<<endl;
}
system("pause");
return 0;
複製代碼
作者:
林廷翰
時間:
2015-1-31 11:29
[code][/#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"input a";
cin>>a
cout<<"input b";
cin>>b
cout<<"A="<<a<<endl
cout<<"B="<<b<<endl
if{
cout<<"a大於b"<<endl;
}
else if {
cout<<"a小於b"<<endl
}
{
cout<<"a等於b"<<endl
}
system("pause")
return 0;
}
code]
作者:
鍾奕帆
時間:
2015-1-31 11:41
system("pause");
return 0;
}
複製代碼
作者:
曾聖祐
時間:
2015-1-31 11:44
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"輸入a:";
cin>>a;
cout<<"輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a大於b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a等於b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
鍾奕帆
時間:
2015-1-31 12:04
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a大於b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a等於b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
曾筱文
時間:
2015-2-1 09:25
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"請輸入a:";
cina>>a;
cout<<"請輸入b:";
cina>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<a<<endl;
if(a>b)
{
cout<<"a大於b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a等於b"<<endl;
}
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2