- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- //宣告
- int a=0;
- int b=0;
- if(a>b)
- {
- cout<<"a>b"<<"\r\n";
- }
- else if(a<b)
- cout<<"a<B"<<"\r\n";
- else
- {
- cout<<"a=b"<<"\r\n";
- }
- cout<<"請輸入a的值";
- cin>>a;
- cout<<"請輸入b的值";
- cin>>b;
- cout<<"a="<<"\r\n";
- cout<<"b="<<"\r\n";
- cout<<"a=b"<<"\r\n";
- system("pause");
- return 0;
- }
複製代碼 |