+ 加
- 減
* 乘
/ 除
% 取餘數
![](https://seed.istak.org.tw/attachment.php?aid=MTE3N3w5NmY1MGJhZXwxNDcyMjgwNDc1fGRkYTcrZFNIM0NCblFtblNyRWRUV3A2UFdLcVJRckhiZkwzS3ltRXptSEh4Zk1V&noupdate=yes) - #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int x=10, y=3;
- 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<<endl;
- cout<<"x%y="<<x%y<<endl;
- system("pause");
- return 0;
- }
複製代碼 |