標題:
[隨堂測驗] 基本輸入輸出 (二)
[打印本頁]
作者:
陳品肇
時間:
2018-7-9 10:41
標題:
[隨堂測驗] 基本輸入輸出 (二)
試實作如下之執行畫面:
[attach]4438[/attach]
作者:
郭子揚
時間:
2018-7-10 09:11
#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;
}
複製代碼
作者:
古蕾娜
時間:
2018-7-10 09:14
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int x;
cout<<"please enter a whole number:";
cin>>x;
int y;
cout<<"please enter a whole number:";
cin>>y;
cout<<"when x's value is "<<x<<",y's value is"<<y<<"when..."<<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;
}
複製代碼
作者:
曲書辰
時間:
2018-7-10 09:15
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x, 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;
}
複製代碼
作者:
高瑞宥
時間:
2018-7-10 09:17
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int x;
cout<<"please enter a whole number:";
cin>>x;
int y;
cout<<"please enter a whole number:";
cin>>y;
cout<<"when x's value is "<<x<<",y's value is"<<y<<"when..."<<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;
}
複製代碼
作者:
古昇暘
時間:
2018-7-10 09:18
#include<iostream>
#include<cstdlib>
using namespace std;
int main() //int ---> integer 整數
{
int x, y;
cout<<"the value of x :";
cin>>x;
cout<<"the value of 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;
}
複製代碼
作者:
陳元謙
時間:
2018-7-10 09:18
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x;
int 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;
}
複製代碼
作者:
王立勝
時間:
2018-7-10 09:19
#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的值為"<<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;
}
複製代碼
作者:
王立恩
時間:
2018-7-10 09:19
#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值為"<<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;
}
複製代碼
作者:
陳元晴
時間:
2018-7-10 09:20
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int x;
int 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;
}
複製代碼
作者:
張百閎
時間:
2018-7-10 09:21
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x;
int y;
cout<<"請輸入一個整數:"<<endl;
cin>>x;
cout<<"請在輸入一個整數:"<<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;
}
複製代碼
作者:
蘇立維
時間:
2018-7-10 09:22
#include<iostream>
#include<cstdlib>
using namespace std;
int main() //int ---> integer 整數
{
int x;
cout<<"請輸入第一個數";
cin>> x;
int y;
cout<<"請輸入第二個數";
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;
}
複製代碼
作者:
吳柏佑
時間:
2018-7-10 09:22
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x;
cin>>x;
cout<<"當x值為"<<x<<endl;
int y;
cin>>y;
cout<<"當y值為"<<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;
}
複製代碼
作者:
游芸溱
時間:
2018-7-10 09:25
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a,b;
cout<<"請輸入a:";
cin>>a;
cout<<"請輸入b:";
cin>>b;
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
if(a>b)
{
cout<<"a大於b"<<endl;
}
else if(a<b)
{
cout<<"a小於b"<<endl;
}
else
{
cout<<"a等於b"<<endl;
}
system("pause");
return 0;
}
複製代碼
作者:
許家華
時間:
2018-7-10 09:25
#include<iostream>
#include<cstdlib>
using namespace std;
int main() //int ---> integer 整數
{
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;
}
複製代碼
作者:
黃怡臻
時間:
2018-7-10 09:28
#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;
}
複製代碼
作者:
張韶庭
時間:
2018-7-10 09:29
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x,y;
cout<<"請輸入一個整數:";
cin>>x;
cout<<"請輸入一個整數:";
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;
}
複製代碼
作者:
李珮薰
時間:
2018-7-10 09:30
#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;
}
複製代碼
作者:
吳孟修
時間:
2018-7-10 09:32
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int x;
int 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;
}
複製代碼
作者:
吳孟書
時間:
2018-7-10 09:33
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int a;
int b;
cout<<"輸入x的值"<<endl;
cin>> a;
cout<<"輸入y的值"<<endl;
cin>> b;
cout<<"x+y="<<a+b<<endl;
cout<<"x-y="<<a-b<<endl;
cout<<"x*y="<<a*b<<endl;
cout<<"x/y="<<a/b<<endl;
cout<<"x%y="<<a%b<<endl;
system("pause");
return 0;
}
複製代碼
作者:
張仲亨
時間:
2018-7-10 09:34
#include<iostream>
#include<cstdlib>
using namespace std;
int main() //int ---> integer 整數
{
int x,y;
cout<<"請輸入y的值"<<endl;
cin>>y;
cout<<"請輸入x的值"<<endl;
cin>>x;
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;
複製代碼
作者:
林楷喆
時間:
2018-7-10 09:35
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x;
int y;
cout<<"請輸入第一個數";
cin>>x;
cout<<"請輸入第二個數";
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;
}
複製代碼
作者:
游芸溱
時間:
2018-7-10 10:00
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
int x;
cin>>x;
cout<<"當x值為"<<x<<endl;
int y;
cin>>y;
cout<<"當y值為"<<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;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2