- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int x,y;
- cout<<"請輸入x=";
- cin>>x;
- cout<<"請輸入y=";
- cin>>y;
- cout<<"x是"<<x<<",y是"<<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<<"餘"<<x%y<<endl;
- system("pause");
- return 0;
- }
複製代碼 |