本帖最後由 章幼莛 於 2018-10-13 14:29 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- float x,y;
- cout<<"請輸入整數x:";
- cin>>x;
- cout<<"請輸入整數y:";
- cin>>y;
- cout<<"當x為:"<<x<<endl;
- cout<<"當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<<endl;
- system("pause");
- return 0;
- }
複製代碼 |