標題:
五則運算 (二)
[打印本頁]
作者:
tonyh
時間:
2013-2-16 15:22
標題:
五則運算 (二)
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x, y; //宣告兩個整數變數
cout<<"請輸入x的值: ";
cin>>x;
cout<<"請輸入y的值: ";
cin>>y;
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;
}
複製代碼
作者:
劉泳鱔
時間:
2013-2-16 15:24
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x, y;
cout<<"請輸入x的值"<<endl;
cin>>x;
cout<<"請輸入y的值"<<endl;
cin>>y;
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;
}
複製代碼
作者:
劉得旗
時間:
2013-2-16 15:25
#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;
}
複製代碼
作者:
蘇昱安
時間:
2013-2-16 15:25
#include <iostream>
#include<cstdlib>
using namespace std ;
int main()
{
int x, y;
cout<<"請輸入x的值: ";
cin>>x;
cout<<"請輸入y的值: ";
cin>>y;
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;
}
作者:
林鎧言
時間:
2013-2-16 15:26
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"請輸入x的值:";
cin>>x;
cout<<"請輸入y的值:";
cin>>y;
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;
}
複製代碼
作者:
黃柏維
時間:
2013-2-16 15:27
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"請輸入x的值: ";
cin>>x;
cout<<"請輸入y的值: ";
cin>>y;
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;
}
複製代碼
作者:
林長逸
時間:
2013-2-16 15:27
#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;
}
複製代碼
作者:
許逸群
時間:
2013-2-16 15:28
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<" 輸入x的值";
cout<<" 輸入y的值";
cin>>y>>endl;
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;
}
複製代碼
作者:
郭凡瑛
時間:
2013-3-2 17:04
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<< " 請輸入x的值: ";
cin>> x;
cout<< " 請輸入y的值: ";
cin>> y;
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;
}
複製代碼
作者:
黃崇維
時間:
2013-3-2 17:05
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout <<"請輸入x的值:";
cin >>x;
cout <<"請輸入y的值:";
cin >>y;
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;
}
複製代碼
作者:
林以諾
時間:
2013-3-12 20:26
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"請輸入x的值:";
cin>>x;
cout<<"請輸入y的值:";
cin>>y;
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;
}
複製代碼
作者:
張瀚仁
時間:
2013-3-21 20:44
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x, y;
cout<<"請輸入x的值: ";
cin>>x;
cout<<"請輸入y的值: ";
cin>>y;
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;
}
複製代碼
作者:
may
時間:
2013-8-10 16:18
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"請輸入x的值:";
cin>>x;
cout<<"請輸入y的值:";
cin>>y;
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;
}
複製代碼
作者:
李彥彤
時間:
2013-8-10 16:19
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x=12,y=5;
cout<<"請輸入x的值:";
cin>>x;
cout<<"請輸入y的值:";
cin>>y;
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;
cout<<"x%y="<< x%y << endl;
system("pause");
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2