本帖最後由 許晏睿 於 2021-4-22 17:52 編輯
- #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;
-
- }
複製代碼 |