標題:
五則運算 (一)
[打印本頁]
作者:
歐柏罕
時間:
2017-9-25 20:35
標題:
五則運算 (一)
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num = 10;
int num2 = 11;
cout << num << "+" << num2 << "=" << num+num2 << endl;
cout << num << "-" << num2 << "=" << num-num2 << endl;
cout << num << "*" << num2 << "=" << num*num2 << endl; //乘法 *
cout << num << "/" << num2 << "=" << num/num2 << endl; //除法 /
cout << num << "%" << num2 << "=" << num%num2 << endl; //取餘數 %
system("pause");
return 0;
}
複製代碼
作者:
彭煥宇
時間:
2017-9-25 20:36
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num=10;
int num2=11;
cout<<num<<"+"<<num2<<"="<<num+num2<<endl;
cout<<num<<"-"<<num2<<"="<<num-num2<<endl;
cout<<num<<"*"<<num2<<"="<<num*num2<<endl;
cout<<num<<"/"<<num2<<"="<<num/num2<<endl;
cout<<num<<"%"<<num2<<"="<<num%num2<<endl;
system("pause");
return 0;
}
複製代碼
作者:
盧佑芯
時間:
2017-9-25 20:37
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num = 10;
int num2 = 11;
cout<<num<<"+"<<num2<<"="<<num+num2<<endl;
cout<<num<<"-"<<num2<<"="<<num-num2<<endl;
cout<<num<<"*"<<num2<<"="<<num*num2<<endl;
cout<<num<<"/"<<num2<<"="<<num/num2<<endl;
cout<<num<<"%"<<num2<<"="<<num%num2<<endl;
system("pause");
return 0;
}
複製代碼
作者:
盧佑恩
時間:
2017-9-25 20:37
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num1 =10;
int num2 =11;
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-9-25 20:37
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num=72176;
int num2=59643;
cout<<num<<"+"<<num2<<"="<<num+num2<<endl;
cout<<num<<"-"<<num2<<"="<<num+num2<<endl;
cout<<num<<"*"<<num2<<"="<<num+num2<<endl;
cout<<num<<"/"<<num2<<"="<<num+num2<<endl;
cout<<num<<"%"<<num2<<"="<<num+num2<<endl;
system("pause");
return 0;
}
複製代碼
作者:
曾堂桂
時間:
2017-9-25 20:38
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int number1=10,number2=5;
cout<<number1<<"+"<<number2<<"="<<number1+number2<<endl;
cout<<number1<<"-"<<number2<<"="<<number1-number2<<endl;
cout<<number1<<"*"<<number2<<"="<<number1*number2<<endl;
cout<<number1<<"%"<<number2<<"="<<number1%number2<<endl;
system("pause");
return 0;
}
複製代碼
作者:
李治毅
時間:
2017-9-25 20:38
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num=10;
int num2=5;
cout<<num<<"+"<<num2<<"="<<num+num2<<endl;
cout<<num<<"-"<<num2<<"="<<num-num2<<endl;
cout<<num<<"*"<<num2<<"="<<num*num2<<endl;
cout<<num<<"/"<<num2<<"="<<num/num2<<endl;
cout<<num<<"%"<<num2<<"="<<num%num2<<endl;
system("pause");
return 0;
}
複製代碼
作者:
沈子晏
時間:
2017-9-25 20:39
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num =10;
int num2 =5;
cout << num <<"+"<< num2 <<"="<< num+num2 << endl;
cout << num <<"-"<< num2 <<"="<< num-num2 << endl;
cout << num <<"*"<< num2 <<"="<< num*num2 << endl;
cout << num <<"/"<< num2 <<"="<< num/num2 << endl;
system("pause");
return 0;
}
複製代碼
作者:
洪翊展
時間:
2017-10-2 19:47
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int num =31515;
int num2 =655151;
cout << num << "+" << num2 << "=" << num%num2 << endl;
cout << num << "-" << num2 << "=" << num%num2 << endl;
cout << num << "*" << num2 << "=" << num%num2 << endl;
cout << num << "/" << num2 << "=" << num%num2 << endl;
cout << num << "%" << num2 << "=" << num%num2 << endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2