標題:
四則運算(二)
[打印本頁]
作者:
歐柏罕
時間:
2017-11-11 16:45
標題:
四則運算(二)
#include<iostream> //輸入輸出
#include<cstdlib> //函式庫
using namespace std;
int main()
{
int num1 = 7;
int num2 = 5;
cout << num1 << " + " << num2 << " = " << num1+num2 << endl; //變數相加
cout << num1 << " - " << num2 << " = " << num1-num2 << endl;
cout << num1 << " * " << num2 << " = " << num1*num2 << endl;
cout << num1 << " / " << num2 << " = " << num1/num2 << endl;
cout << num1 << " % " << num2 << " = " << num1%num2 << endl;
system("pause");
return 0;
}
複製代碼
作者:
戴嘉禾
時間:
2017-11-11 16:47
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num1 = 7;
int num2 = 5;
cout << num1 << " + " << num2 << " = " << num1+num2 << endl;
cout << num1 << " - " << num2 << " = " << num1-num2 << endl;
cout << num1 << " * " << num2 << " = " << num1*num2 << endl;
cout << num1 << " / " << num2 << " = " << num1/num2 << endl;
cout << num1 << " % " << num2 << " = " << num1%num2 << endl;
system("pause");
return 0;
}
複製代碼
作者:
黃安立
時間:
2017-11-11 16:48
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num1 = 7;
int num2 = 5;
cout << num1 << " + " << num2 << " = " << num1+num2 << endl;
cout << num1 << " - " << num2 << " = " << num1-num2 << endl;
cout << num1 << " * " << num2 << " = " << num1*num2 << endl;
cout << num1 << " / " << num2 << " = " << num1/num2 << endl;
cout << num1 << " % " << num2 << " = " << num1%num2 << endl;
system("pause");
return 0;
}
複製代碼
作者:
蔡佳承
時間:
2017-11-11 16:51
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num1=7;
int num2=5;
cout<<num1<<"+"<<num2<<"="<<num1+num2<<endl;
cout<<num1<<"-"<<num2<<"="<<num1-num2<<endl;
cout<<num1<<"*"<<num2<<"="<<num1*num2<<endl;
cout<<num1<<"/"<<num2<<"="<<num1/num2<<endl;
cout<<num1<<"%"<<num2<<"="<<num1%num2<<endl;
system("pause");
return 0;
}
複製代碼
作者:
顏可昕
時間:
2017-11-11 16:55
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num1=7;
int num2=5;
cout<<num1<<"+"<<num2<<"="<<num1+num2<<endl;
cout<<num1<<"-"<<num2<<"="<<num1-num2<<endl;
cout<<num1<<"*"<<num2<<"="<<num1*num2<<endl;
cout<<num1<<"/"<<num2<<"="<<num1/num2<<endl;
cout<<num1<<"%"<<num2<<"="<<num1%num2<<endl;
system("pause");
return 0;
}
複製代碼
作者:
顏詢
時間:
2017-11-11 16:55
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num1= 1 ;
int num2= 1 ;
cout << num1 << "+" <<num2<<"="<<num1+num2<<endl;
cout << num1 << "-" <<num2<<"="<<num1-num2<<endl;
cout << num1 << "*" <<num2<<"="<<num1*num2<<endl;
cout << num1 << "/" <<num2<<"="<<num1/num2<<endl;
cout << num1 << "%" <<num2<<"="<<num1%num2<<endl;
system("pause");
return 0;
}
複製代碼
作者:
佳
時間:
2017-11-11 16:56
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num1=7;
int num2=5;
cout<<num1<<"+"<<num2<<"="<<num1+num2<<endl;
cout<<num1<<"-"<<num2<<"="<<num1-num2<<endl;
cout<<num1<<"*"<<num2<<"="<<num1*num2<<endl;
cout<<num1<<"/"<<num2<<"="<<num1/num2<<endl;
cout<<num1<<"%"<<num2<<"="<<num1%num2<<endl;
system("pause");
return 0;
}
複製代碼
作者:
顏可晴
時間:
2017-11-11 17:00
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num1=7;
int num2=5;
cout<<num1<<"+"<<num2<<"="<<num1+num2<<endl;
cout<<num1<<"-"<<num2<<"="<<num1-num2<<endl;
cout<<num1<<"*"<<num2<<"="<<num1*num2<<endl;
cout<<num1<<"/"<<num2<<"="<<num1/num2<<endl;
cout<<num1<<"%"<<num2<<"="<<num1%num2<<endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2