標題:
五則運算 (一)
[打印本頁]
作者:
周政輝
時間:
2017-3-4 10:03
標題:
五則運算 (一)
#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;
}
複製代碼
作者:
莊旻叡
時間:
2017-3-4 10:14
#include<cstdlib>
#include<iostream>
using namespace std;
int main()
{
int a=10,b=5;
cout<<a+b<<endl;
cout<<a-b<<endl;
cout<<a*b<<endl;
cout<<a/b<<endl;
cout<<a%b<<endl;
system("pause");
return 0;
}
複製代碼
作者:
高品溫
時間:
2017-3-4 10:14
#include<cstdlib>
#include<iostream>
using namespace std;
int main()
{
int a=11,b=20;
cout<< a+b <<endl;
cout<< a-b <<endl;
cout<< a*b <<endl;
cout<< a/b <<endl;
cout<< a%b <<endl;
system("pause");
return 0;
}
複製代碼
作者:
高睿辰
時間:
2017-3-4 10:15
#include<cstdlib>
#include<iostream>
using namespace std;
int main()
{
int a=10,b=10;
cout<<a+b<<endl;
cout<<a-b<<endl;
cout<<a*b<<endl;
cout<<a/b<<endl;
cout<<a%b<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2