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