標題:
五則運算 (二)
[打印本頁]
作者:
tonyh
時間:
2014-8-23 11:25
標題:
五則運算 (二)
本帖最後由 tonyh 於 2014-8-23 11:36 編輯
[attach]951[/attach]
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"請輸入x的值: ";
cin>>x;
cout<<"請輸入y的值: ";
cin>>y;
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;
}
複製代碼
作者:
洪振庭
時間:
2014-8-23 11:32
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"x=";
cin>>x;
cout<<"y=";
cin>>y;
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;
}
複製代碼
作者:
梁和雋
時間:
2014-8-23 11:32
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x;
int y;
cout<<"請輸入X"<<endl;
cin>>x;
cout<<"請輸入Y"<<endl;
cin>>y;
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;
}
複製代碼
作者:
李大全
時間:
2014-8-23 11:33
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"x=";
cin>>x;
cout<<"y=";
cin>>y;
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;
}
複製代碼
作者:
謝瀞儀
時間:
2014-8-23 11:42
本帖最後由 謝瀞儀 於 2014-8-23 11:45 編輯
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"x=";
cin>>x;
cout<<"y=";
cin>>y;
cout<<x<<"-"<<y<<"="<<x-y<<"\a"<<"\n";
system("pause");
cout<<x<<"*"<<y<<"="<<x*y<<"\a"<<"\n";
system("pause");
cout<<x<<"/"<<y<<"="<<x/y<<"\a"<<"\n";
system("pause");
cout<<x<<"+"<<y<<"="<<x+y<<"\a"<<"\n";
system("pause");
cout<<x<<"%"<<y<<"="<<x%y<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
cout<<"\a"<<"\n";
system("pause");
return 0;
}
複製代碼
作者:
李知易
時間:
2014-8-23 11:45
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"請輸入x的值";
cin>>x;
cout<<"請輸入y的值";
cin>>y;
cout<<x<<"+"<<"y"<<"=\a"<<x+y<<endl;
cout<<x<<"-"<<y<<"=\a"<<x-y<<endl;
cout<<x<<"*"<<y<<"=\a"<<x*y<<endl;
cout<<x<<"/"<<y<<"=\a"<<x/y<<endl;
cout<<x<<"%"<<y<<"=\a"<<x%y<<endl;
system ("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2