本帖最後由 趙一鳴 於 2018-10-13 14:30 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int x,y;
- cout<<"請輸入整數x:";
- cin>>x;
- cout<<"請輸入整數y:";
- cin>>y;
- cout<<x<<"+"<<y<<"="<<x+y<<endl;
- cout<<x<<"-"<<y<<"="<<x-y<<endl;
- cout<<x<<"*"<<y<<"="<<x*y<<endl;
- cout<<x<<"/"<<y<<"="<<x/y<<endl;
- cout<<x<<"%"<<y<<"="<<x%y<<endl;
- system("pause");
- return 0;
- }
複製代碼 |