課程總結
學習目標 單元名稱(題數) 配分 得分 完成率 時間
輸出函數 測試系統(1) 100 100 100% 2021/1/15
讓螢幕會做秀(6) 100 100 100% 2020/10/7
輸出函數總結 200 200 100% 2020/10/7
變數宣告 資料也有家(8) 105 105 100% 2020/10/27
用電腦玩加法(6) 105 105 100% 2020/10/23
變數宣告總結 210 210 100% 2020/10/23
輸入函數 給什麼印什麼(10) 105 105 100% 2020/10/28
加減乘除取餘數(10) 110 110 100% 2021/1/13
輸入函數總結 215 215 100% 2021/1/13
選擇結構 只選我要的(5) 105 105 100% 2020/12/9
if的妙用(4) 105 105 100% 2020/11/25
else魔法(8) 105 105 100% 2021/1/5
比較中有比較(4) 105 101 96% 2021/1/5
多選一(9) 105 83 79% 2021/1/15
選擇結構總結 525 499 95% 2021/1/15
上機考01 109上第1次上機考(B)(6) 115 115 100% 2020/11/25
上機考01總結 115 115 100% 1900/2/1
109上第1次上機考(B)(複習)(6) 115 115 100% 2020/12/10
*總結 265 115 43% 2020/12/10
上機考01 109上第2次上機考(8) 150 120 80% 2021/1/6
上機考01總結 150 120 80% 2020/12/10
[1年3班], 10307 , 沈宏霖
Page 1, 沈宏霖(10307)@1年3班
參考資料
[1] 測試系統
Page 2, 沈宏霖(10307)@1年3班
測試系統(C)(PDF) https://drive.google.com/file/d/1ehsbhPdSsb-F2OAKJ4_JjC86AhZKtFbj/preview
測試系統(C++)(PDF) https://drive.google.com/file/d/1Q6eR-cp5CzWmcg78UY9Vkg6K7ihOjVUO/preview
總結
[1] 測試系統
Page 2, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 Hello, DICE 100.0 100.0 14 2021/1/15 下午 02:58:13
100 100
1. Hello, DICE
Score: 100.0 Lang: c
Student Answer:
Score Times Completed Time
100.0 14 2021/1/15 下午 02:58:13
Language Code
Python print("Hello, DICE!")
C++ #include <iostream>
using namespace std;
int main()
{
cout<<"Hello, DICE!"<<endl;
return 0;
}
C
Java public class Main {
public static void main(String[] args) {
System.out.println("Hello, DICE!");
}
}
[1] 測試系統
Page 4, 沈宏霖(10307)@1年3班
參考資料
[2]讓螢幕會做秀
Page 5, 沈宏霖(10307)@1年3班
輸出函數(C)(PDF) https://drive.google.com/file/d/1gEsmEqn9H7IB8OmYS5eVj5FuLmaVIGAp/preview
輸出函數(C++)(PDF) https://drive.google.com/file/d/1lwMibOEIrg-EQNbTeQNX7SoNoOb0-hOT/preview
總結
[2]讓螢幕會做秀
Page 5, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 SayHello 10.0 10.0 1 2020/10/7 上午 07:03:22
2 印三角形 10.0 10.0 2 2020/10/7 上午 07:05:35
3 倒印三角形 20.0 20.0 1 2020/10/7 上午 07:07:38
4 不是計算 20.0 20.0 1 2020/10/7 上午 07:09:27
5 來個表格 20.0 20.0 2 2020/10/7 下午 12:13:37
6 身高體重 20.0 20.0 1 2020/10/7 下午 12:16:43
100 100
1. SayHello
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 1 2020/10/7 上午 07:03:22
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!" << endl;
return 0;
}
[2]讓螢幕會做秀
Page 6, 沈宏霖(10307)@1年3班
2. 印三角形
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 2 2020/10/7 上午 07:05:35
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
cout << "*" << endl;
cout << "**" << endl;
cout << "***" << endl;
cout << "****" << endl;
cout << "*****" << endl;
cout << "******" << endl;
return 0;
}
[2]讓螢幕會做秀
Page 7, 沈宏霖(10307)@1年3班
3. 倒印三角形
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/10/7 上午 07:07:38
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
cout << "******" << endl;
cout << "*****" << endl;
cout << "****" << endl;
cout << "***" << endl;
cout << "**" << endl;
cout << "*" << endl;
return 0;
}
[2]讓螢幕會做秀
Page 8, 沈宏霖(10307)@1年3班
4. 不是計算
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/10/7 上午 07:09:27
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
cout << "2-3=5" << endl;
return 0;
}
[2]讓螢幕會做秀
Page 9, 沈宏霖(10307)@1年3班
5. 來個表格
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 2 2020/10/7 下午 12:13:37
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
cout << "1 1 1" << endl;
cout << "2 4 8" << endl;
cout << "3 9 27" << endl;
cout << "4 16 64" << endl;
cout << "5 25 125" << endl;
cout << "6 36 216" << endl;
cout << "7 49 343" << endl;
cout << "8 64 512" << endl;
cout << "9 81 729" << endl;
cout << "10 100 1000" << endl;
return 0;
}
[2]讓螢幕會做秀
Page 10, 沈宏霖(10307)@1年3班
6. 身高體重
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/10/7 下午 12:16:43
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
cout << "Height: 158CM" << endl;
cout << "Weight: 55.66KG" << endl;
return 0;
}
[2]讓螢幕會做秀
Page 11, 沈宏霖(10307)@1年3班
參考資料
[3]資料也有家
Page 12, 沈宏霖(10307)@1年3班
變數與指定運算子(C)(PDF) https://drive.google.com/file/d/1VFwAqvp104-ukQ1H-5_6bYEc0wHCYA65/preview
變數與指定運算子(C++)(PDF) https://drive.google.com/file/d/1gSJSO-5OAH6zU3YEf35rP4v9ePDFT-gM/preview
總結
[3]資料也有家
Page 12, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 印出指定的整數 15.0 15.0 1 2020/10/7 下午 12:21:40
2 加上一些形容詞 15.0 15.0 1 2020/10/7 下午 12:39:17
3 印出2個指定的整數 15.0 15.0 1 2020/10/21 上午 06:54:54
4 印出指定的浮點數 15.0 15.0 1 2020/10/21 上午 07:15:03
5 身高與體重 15.0 15.0 4 2020/10/27 下午 02:19:31
6 最後來的是主人 15.0 15.0 1 2020/10/22 上午 01:17:41
7 最後的結果是? 10.0 10.0 3 2020/10/22 上午 01:32:52
8 自主學習 5.0 5.0 2 2020/10/22 上午 01:35:35
105 105
1. 印出指定的整數
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 1 2020/10/7 下午 12:21:40
Language Code
C++ #include<iostream>
using namespace std;
int main()
{
int num;
num=3;
cout <<num<<endl;
return 0;
}
[3]資料也有家
Page 13, 沈宏霖(10307)@1年3班
2. 加上一些形容詞
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 1 2020/10/7 下午 12:39:17
Language Code
C++ #include<iostream>
using namespace std;
int main()
{
int cat;
cat=3;
cout <<"There are ";
cout <<cat;
cout <<" cats."<<endl;
return 0;
}
[3]資料也有家
Page 14, 沈宏霖(10307)@1年3班
3. 印出2個指定的整數
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 1 2020/10/21 上午 06:54:54
Language Code
C++ /*3_3.資料也有家-印出2個指定的整數(15.0)*/
#include <iostream>
using namespace std;
int main()
{
int a,b;
a=3,b=4;
cout<< a << endl;
cout<< b << endl;
return 0;
}
[3]資料也有家
Page 15, 沈宏霖(10307)@1年3班
4. 印出指定的浮點數
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 1 2020/10/21 上午 07:15:03
Language Code
C++ /*3_4.資料也有家-印出指定的浮點數(15.0)*/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float num1;
num1=10.100000;
cout<< fixed << setprecision(4) << "num1=10.100000" <<endl;
float num2;
num2=5.200000;
cout<< fixed << setprecision(4) << "num2=5.200000" <<endl;
return 0;
}
[3]資料也有家
Page 16, 沈宏霖(10307)@1年3班
5. 身高與體重
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 4 2020/10/27 下午 02:19:31
Language Code
C++ /*3_5.資料也有家-身高與體重(15.0)*/
#include <iostream>
#include<iomanip>
using namespace std;
int main(){
int a;
a=160;
cout<<"My height is "<<a<<" CM."<<endl;
float b;
b=55.22;
cout<<"My weight is "<<b<<" KG."<<endl;
return 0;
}
[3]資料也有家
Page 17, 沈宏霖(10307)@1年3班
6. 最後來的是主人
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 1 2020/10/22 上午 01:17:41
Language Code
C++ /*3_6.資料也有家-最後來的是主人(15.0)*/
#include <iostream>
using namespace std;
int main() {
int a;
a=1;
a=2;
a=3;
a=4;
a=5;
cout<<a<<endl;
return 0;
}
[3]資料也有家
Page 19, 沈宏霖(10307)@1年3班
7. 最後的結果是?
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 3 2020/10/22 上午 01:32:52
Language Code
C++ /*3_7.資料也有家-最後的結果是?(10.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b;
a=5,b=10;
a=b;
b=a;
cout<< a <<"t"<< b <<endl;
return 0;
}
[3]資料也有家
Page 20, 沈宏霖(10307)@1年3班
8. 自主學習
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
5.0 2 2020/10/22 上午 01:35:35
Language Code
C++ /*3_8.資料也有家-自主學習(5.0)*/
#include <iostream>
using namespace std;
int main() {
int a;
for( a=97 ; a<=97 ; a++ )
{
cout << "" << (char)a << endl;
}
return 0;
}
[3]資料也有家
Page 21, 沈宏霖(10307)@1年3班
參考資料
[4]用電腦玩加法
Page 22, 沈宏霖(10307)@1年3班
加法(C)(PDF) https://drive.google.com/file/d/1ESOGCD2QVzq0Lut9rwFBiz8YQV6M3rAa/preview
加法(C++)(PDF) https://drive.google.com/file/d/176myBftbNfYbWePZ5CGy3Swk8g0qKCjJ/preview
總結
[4]用電腦玩加法
Page 22, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 數蘋果 20.0 20.0 1 2020/10/22 上午 01:38:43
2 =不是等號 20.0 20.0 5 2020/10/22 上午 01:47:14
3 加法再現 20.0 20.0 1 2020/10/22 上午 01:49:15
4 四捨五入 20.0 20.0 1 2020/10/22 上午 01:52:20
5 計算一下 20.0 20.0 1 2020/10/23 上午 11:50:50
6 自主學習 5.0 5.0 1 2020/10/23 上午 11:56:03
105 105
1. 數蘋果
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/10/22 上午 01:38:43
Language Code
C++ /*4_1.用電腦玩加法-數蘋果(20.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c;
a=3,b=4;
c=a+b;
cout<<a<<"+"<<b<<"="<<c<<endl;
return 0;
}
[4]用電腦玩加法
Page 23, 沈宏霖(10307)@1年3班
2. =不是等號
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 5 2020/10/22 上午 01:47:14
Language Code
C++ /*4_2.用電腦玩加法-=不是等號(20.0)*/
#include <iostream>
using namespace std;
int main() {
int a=3;
a=a+10;
cout<<"a變為"<<a<<endl;
return 0;
}
[4]用電腦玩加法
Page 24, 沈宏霖(10307)@1年3班
3. 加法再現
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/10/22 上午 01:49:15
Language Code
C++ /*4_3.用電腦玩加法-加法再現(20.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c;
a=3,b=4;
c=a+b;
cout<<a<<"+"<<b<<"="<<c<<endl;
return 0;
}
[4]用電腦玩加法
Page 25, 沈宏霖(10307)@1年3班
4. 四捨五入
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/10/22 上午 01:52:20
Language Code
C++ /*4_4.用電腦玩加法-四捨五入(20.0)*/
#include <iostream>
#include<iomanip>
using namespace std;
int main() {
float a,b,c;
a=4.210000,b=3.100000;
c=a+b;
cout<<fixed<<setprecision(2)<<c;
return 0;
}
[4]用電腦玩加法
Page 26, 沈宏霖(10307)@1年3班
5. 計算一下
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/10/23 上午 11:50:50
Languag
e
Code
C++ /*4_5.用電腦玩加法-計算一下(20.0)*/
#include <iostream>
using namespace std;
int main() {
float a1,a2,a3,a4,a5,b;
a1=5,a2=9,a3=8,a4=25,a5=13;
b=a1+a2+a3+a4+a5;
cout<<a1<<"+"<<a2<<"+"<<a3<<"+"<<a4<<"+"<<a5<<"="<<b<<
endl;
cout<<"a1+a2+a3+a4+a5="<<b<<endl;
return 0;
}
[4]用電腦玩加法
Page 27, 沈宏霖(10307)@1年3班
6. 自主學習
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
5.0 1 2020/10/23 上午 11:56:03
Language Code
C++ #include <stdio.h>
int main()
{
int a=97;
printf("%c",a=a+2);
return 0;
}
[4]用電腦玩加法
Page 28, 沈宏霖(10307)@1年3班
參考資料
[5]給什麼印什麼
Page 29, 沈宏霖(10307)@1年3班
變數與輸入函數(C)(PDF) https://drive.google.com/file/d/1Tf1P04ta1VbTjKCGDE7tFqEo9vkEB4O2/preview
變數與輸入函數(C++)(PDF) https://drive.google.com/file/d/1VEWTU325cs3RLMEfx2aPUcbD2hXJkUS2/preview
總結
[5]給什麼印什麼
Page 29, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 輸入1個整數 10.0 10.0 2 2020/10/23 下午 12:42:40
2 輸入2個整數 10.0 10.0 1 2020/10/23 下午 12:46:24
3 兩整數相加 15.0 15.0 2 2020/10/28 上午 07:07:50
4 浮點數 15.0 15.0 2 2020/10/23 下午 01:00:23
5 3個浮點數 10.0 10.0 1 2020/10/26 下午 12:01:39
6 身高與體重 10.0 10.0 2 2020/10/28 上午 06:47:47
7 倒序 10.0 10.0 1 2020/10/26 下午 12:11:17
8 長方形 10.0 10.0 2 2020/10/26 下午 12:15:07
9 印出資料 10.0 10.0 15 2020/10/28 上午 07:02:53
10 自主學習 5.0 5.0 1 2020/10/26 下午 12:25:46
105 105
1. 輸入1個整數
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 2 2020/10/23 下午 12:42:40
Language Code
C++ #include<iostream>
using namespace std;
int main()
{
int num;
cin>>num;
cout<<num;
return 0;
}
C #include <stdio.h>
int main()
{
int a;
scanf("%d",&5); //輸入變數a的數值
printf("%d",5);
return 0;
}
[5]給什麼印什麼
Page 31, 沈宏霖(10307)@1年3班
2. 輸入2個整數
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 1 2020/10/23 下午 12:46:24
Language Code
C++ #include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<b;
return 0;
}
[5]給什麼印什麼
Page 32, 沈宏霖(10307)@1年3班
3. 兩整數相加
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 2 2020/10/28 上午 07:07:50
Language Code
C++ #include <stdio.h>
int main()
{
int a,b;
scanf("%dn%d",&a,&b);
printf("%d+%d=%d",a,b,a+b); //印出「a」+「b」=「a+b」
return 0;
}
[5]給什麼印什麼
Page 33, 沈宏霖(10307)@1年3班
4. 浮點數
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 2 2020/10/23 下午 01:00:23
Language Code
C++ #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float a;
cin>>a;
cout<< fixed << setprecision(6) <<a<<endl;
return 0;
}
[5]給什麼印什麼
Page 34, 沈宏霖(10307)@1年3班
5. 3個浮點數
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 1 2020/10/26 下午 12:01:39
Language Code
C++ #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float a,b,c;
cin>>a;
cout<< fixed << setprecision(1) <<a<<endl;
cin>>b;
cout<< fixed << setprecision(2) <<b<<endl;
cin>>c;
cout<< fixed << setprecision(3) <<c<<endl;
return 0;
}
[5]給什麼印什麼
Page 35, 沈宏霖(10307)@1年3班
6. 身高與體重
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 2 2020/10/28 上午 06:47:47
Language Code
C++ #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int a;
float b;
cin>>a;
cout<<"身高"<<a<<"公分"<<endl;
cin>>b;
cout<<"體重"<< fixed << setprecision(2) <<b<<"公斤"<<endl;
return 0;
}
[5]給什麼印什麼
Page 36, 沈宏霖(10307)@1年3班
7. 倒序
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 1 2020/10/26 下午 12:11:17
Language Code
C++ #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int a,b;
cin>>a;
cin>>b;
cout<<b<< "t" <<a<<endl;
return 0;
}
[5]給什麼印什麼
Page 37, 沈宏霖(10307)@1年3班
8. 長方形
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 2 2020/10/26 下午 12:15:07
Language Code
C++ #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int a,b;
cin>>a;
cin>>b;
cout<<a<<"t"<<b<<"t"<<a<<"t"<<b<<endl;
return 0;
}
[5]給什麼印什麼
Page 38, 沈宏霖(10307)@1年3班
9. 印出資料
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 15 2020/10/28 上午 07:02:53
Langu
age
Code
C++ #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int a;
float b;
a=175,b=68.5;
cout<<"姓名:Jack"<<endl;
cout<<"身高:"<<a<<"公分"<<endl;
cout<<"體重:"<<fixed<<setprecision(1)<<b<<"公斤"<<endl;
cout<<"座右銘:Experience is the best teacher."<<endl;
return 0;
}
C #include <stdio.h>
int main()
{
int a=175;
float b=68.5;
printf("姓名:Jackn身高:%d公分n體重:%.1f公斤n座右銘:Experience is
the best teacher.",a,b);
return 0;
}
[5]給什麼印什麼
Page 40, 沈宏霖(10307)@1年3班
10. 自主學習
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
5.0 1 2020/10/26 下午 12:25:46
Language Code
C #include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
printf("%c",a);
return 0;
}
[5]給什麼印什麼
Page 41, 沈宏霖(10307)@1年3班
參考資料
[6]加減乘除取餘數
Page 42, 沈宏霖(10307)@1年3班
運算子(C)(PDF) https://drive.google.com/file/d/1Y_BPJ7-rbPJI-f_6ssCp66Qify3NNYkq/preview
運算子(C++)(PDF) https://drive.google.com/file/d/1sbvX6xT4sOWcjAYdA7sdjxhoxEXtWl-r/preview
總結
[6]加減乘除取餘數
Page 42, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 四則運算 15.0 15.0 2 2020/10/26 下午 01:07:58
2 梯形面積 15.0 15.0 5 2020/10/26 下午 01:07:14
3 溫度換算 10.0 10.0 18 2020/11/11 上午 07:04:23
4 時間計算 10.0 10.0 4 2021/1/13 下午 12:41:35
5 緞帶長度 10.0 10.0 3 2020/10/26 下午 02:03:48
6 年利率 10.0 10.0 2 2020/10/27 下午 12:20:50
7 圓周長與面積 10.0 10.0 1 2020/10/27 下午 12:27:45
8 衛星繞地球 15.0 15.0 1 2020/10/27 下午 12:45:11
9 製作時間 10.0 10.0 3 2020/10/27 下午 01:42:39
10 自主學習 5.0 5.0 1 2020/10/26 下午 01:48:32
110 110
1. 四則運算
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 2 2020/10/26 下午 01:07:58
Langua
ge
Code
C++ #include<iostream>
using namespace std;
int main()
{
int num1,num2;/*宣告二個整數變數*/
cin>>num1>>num2;/*輸入兩個整數變數*/
cout<<num1<<"+"<<num2<<"="<<num1+num2<<endl;/*加*/
cout<<num1<<"-"<<num2<<"="<<num1-num2<<endl;/*減*/
cout<<num1<<"*"<<num2<<"="<<num1*num2<<endl;/*乘*/
cout<<num1<<"/"<<num2<<"="<<num1/num2<<"餘"<<num1%num2<
<endl;/*除與取餘數*/
return 0;
}
C #include <stdio.h>
int main()
{
int a;
int b;
scanf ("%d %d",&a,&b);
printf("%d+%d=%dn",a,b,a+b);
printf("%d-%d=%dn",a,b,a-b);
printf("%d*%d=%dn",a,b,a*b);
printf("%d/%d=%d餘%dn",a,b,a/b,a%b);
return 0;
}
[6]加減乘除取餘數
Page 44, 沈宏霖(10307)@1年3班
2. 梯形面積
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 5 2020/10/26 下午 01:07:14
Langua
ge
Code
C++ #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
float num1,num2,num3;/*宣告二個整數變數*/
cin>>num1>>num2>>num3;/*輸入兩個整數變數*/
cout<<"梯形面積="<<fixed<<setprecision(1)<<
((num1+num2)*num3)/2<<"平方公分"<<endl;
return 0;
}
C #include <stdio.h>
int main()
{
int a,b,c;
float d;
scanf("%d %d %d",&a,&b,&c);
d=(a+b)*c/2;
printf("梯形面積=%.1f平方公分",d);
return 0;
}
[6]加減乘除取餘數
Page 46, 沈宏霖(10307)@1年3班
3. 溫度換算
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 18 2020/11/11 上午 07:04:23
Language Code
C++ #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int a,b,c;
float num1,num2,num3;/*宣告二個整數變數*/
cin>>a>>b>>c;/*輸入兩個整數變數*/
num1=(9.0/5.0)*a+32;
cout<<"1.華氏溫度為"<<fixed<<setprecision(1)<<num1<<endl;
num2=(9.0/5.0)*b+32;
cout<<"2.華氏溫度為"<<fixed<<setprecision(1)<<num2<<endl;
num3=(9.0/5.0)*c+32;
cout<<"3.華氏溫度為"<<fixed<<setprecision(1)<<num3<<endl;
return 0;
}
C #include <stdio.h>
int main()
{
float a,b,c;
scanf("%f %f %f",&a,&b,&c);
printf("1.華氏溫度為%.1fn",(9.0/5.0)*a+32);
printf("2.華氏溫度為%.1fn",(9.0/5.0)*b+32);
printf("3.華氏溫度為%.1f",(9.0/5.0)*c+32);
return 0;
}
[6]加減乘除取餘數
Page 48, 沈宏霖(10307)@1年3班
4. 時間計算
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 4 2021/1/13 下午 12:41:35
Language Code
C++ #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
float min,s,a;/*宣告二個整數變數*/
min=1,s=15;
cin>>a;/*輸入兩個整數變數*/
cout<<a<<"個粽子共需要"<<a*min<<"分"<<a*s<<"秒"<<endl;
return 0;
}
C #include <stdio.h>
int main()
{
int a,m,s;
scanf("%d",&a);
m=75*a/60;
s=75*a-60*m;
printf("%d個粽子共需要%d分%d秒",a,m,s);
return 0;
}
[6]加減乘除取餘數
Page 49, 沈宏霖(10307)@1年3班
5. 緞帶長度
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 3 2020/10/26 下午 02:03:48
Language Code
C #include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
printf("緞帶原來長%d公尺",a*2*2*2);
return 0;
}
C++ #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
float a,b;/*宣告二個整數變數*/
cin>>a;/*輸入兩個整數變數*/
b=a*2*2*2;
cout<<"緞帶原來長"<<b<<"公尺"<<endl;
return 0;
}
[6]加減乘除取餘數
Page 50, 沈宏霖(10307)@1年3班
6. 年利率
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 2 2020/10/27 下午 12:20:50
Language Code
C++ #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int d;
float a,m,c;/*宣告二個整數變數*/
cin>>m>>a>>d;/*輸入兩個整數變數*/
c=(m*a)*d/365;
cout<<fixed<<setprecision(2)<<c<<endl;
cin>>m>>a>>d;/*輸入兩個整數變數*/
c=(m*a)*d/365;
cout<<fixed<<setprecision(2)<<c<<endl;
return 0;
}
[6]加減乘除取餘數
Page 51, 沈宏霖(10307)@1年3班
7. 圓周長與面積
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 1 2020/10/27 下午 12:27:45
Language Code
C++ #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int a,q;
float p,b,c,d;
p=3.14;
cin>>a>>q;
b=2*a*p;
c=a*a*p;
d=(a*a*p)*q/360;
cout<<"圓周長為"<<fixed<<setprecision(2)<<b<<endl;
cout<<"圓面積為"<<fixed<<setprecision(2)<<c<<endl;
cout<<"扇形面積為"<<fixed<<setprecision(2)<<d<<endl;
return 0;
}
[6]加減乘除取餘數
Page 52, 沈宏霖(10307)@1年3班
8. 衛星繞地球
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 1 2020/10/27 下午 12:45:11
Language Code
C++ #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int x,y,z;
cin>>x>>y;/*輸入兩個整數變數*/
z=((x*60)+25/102)/100;
cout<<z<<"圈"<<endl;
return 0;
}
[6]加減乘除取餘數
Page 53, 沈宏霖(10307)@1年3班
9. 製作時間
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 3 2020/10/27 下午 01:42:39
Language Code
C++ /*6_9.加減乘除取餘數-製作時間(10.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c;
float d;
cin>>a>>b;
c=((a*72)+(b*150))/60;
d=((a*72)+(b*150))-(c*60);
cout<<c<<"分"<<d<<"秒"<<endl;
cin>>a>>b;
c=((a*72)+(b*150))/60;
d=((a*72)+(b*150))-(c*60);
cout<<c<<"分"<<d<<"秒"<<endl;
return 0;
}
C #include <stdio.h>
int main()
{
int b,f;
scanf("%d %d",&b,&f);
printf("%d分%d秒n",(72*b+150*f)/60,72*b+150*f-(72*b+150*f)/60*60);
scanf("%d %d",&b,&f);
printf("%d分%d秒",(72*b+150*f)/60,72*b+150*f-(72*b+150*f)/60*60);
return 0;
}
[6]加減乘除取餘數
Page 55, 沈宏霖(10307)@1年3班
10. 自主學習
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
5.0 1 2020/10/26 下午 01:48:32
Language Code
C++ #include <stdio.h>
int main()
{
char a;
scanf("%c",&a);
if((a>='A')&&(a<='Z'))
{
a+=32;
printf("%c",a);
}
else if((a>='a')&&(a<='z'))
{
a-=32;
printf("%c",a);
}
else
{
printf("%c",a);
}
return 0;
}
[6]加減乘除取餘數
Page 56, 沈宏霖(10307)@1年3班
參考資料
[7]只選我要的
Page 57, 沈宏霖(10307)@1年3班
單一選擇(C)(PDF) https://drive.google.com/file/d/1rNFp5Ya681VOq4VVBLLa1KY2caPlmGYb/preview
單一選擇(C++)(PDF) https://drive.google.com/file/d/1IFkSJjWI0M5SG4D3EEXzcUpozcT72cmM/preview
總結
[7]只選我要的
Page 57, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 選正數 25.0 25.0 1 2020/11/11 上午 06:47:47
2 選偶數 25.0 25.0 2 2020/11/25 上午 06:49:29
3 發現不相等 25.0 25.0 2 2020/11/25 下午 01:17:24
4 輸出絕對值 25.0 25.0 9 2020/12/9 上午 06:52:28
5 自主學習 5.0 5.0 1 2020/11/25 下午 01:24:59
105 105
1. 選正數
Score: 25.0 Lang: c
Student Answer:
Score Times Completed Time
25.0 1 2020/11/11 上午 06:47:47
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
int n;/*宣告整數變數*/
cin>>n;/*輸入整數變數*/
if(n>0){
cout<<n<<"是正數"<<endl;
}
return 0;
}
[7]只選我要的
Page 59, 沈宏霖(10307)@1年3班
2. 選偶數
Score: 25.0 Lang: c
Student Answer:
Score Times Completed Time
25.0 2 2020/11/25 上午 06:49:29
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
int n,m;/*宣告整數變數*/
cin>>n;
m=n/2;/*輸入整數變數*/
if(m=1){
cout<<n<<"是偶數"<<endl;
}
return 0;
}
[7]只選我要的
Page 61, 沈宏霖(10307)@1年3班
3. 發現不相等
Score: 25.0 Lang: c
Student Answer:
Score Times Completed Time
25.0 2 2020/11/25 下午 01:17:24
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
int n,m,a;/*宣告整數變數*/
cin>>n>>m;
if(n!=m){
cout<<n<<"!="<<m<<endl;
}
return 0;
}
[7]只選我要的
Page 63, 沈宏霖(10307)@1年3班
4. 輸出絕對值
Score: 25.0 Lang: c
Student Answer:
Score Times Completed Time
25.0 9 2020/12/9 上午 06:52:28
Language Code
C++ #include <iostream>
#include<iomanip>
using namespace std;
int main()
{
float a;/*宣告整數變數*/
cin>>a;
if(a<0){
cout<<fixed<<setprecision(2)<<a*-1<<endl;
}
return 0;
}
C #include <stdio.h>
#include <stdlib.h>
int main ()
{
float a;
scanf("%f",&a);
printf("%.2fn",abs(a)); //印出a的絕對值
return 0;
}
[7]只選我要的
Page 65, 沈宏霖(10307)@1年3班
5. 自主學習
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
5.0 1 2020/11/25 下午 01:24:59
Language Code
C++ #include <stdio.h>
int main()
{
int a,b,e,f;
scanf("%d %d",&a,&b);
if (a==1)
e=2300;
if (a==2)
e=800;
if (a==3)
e=500;
if (a==4)
e=1500;
if (b==1)
f=2300;
if (b==2)
f=800;
if (b==3)
f=500;
if (b==4)
f=1500;
if (e+f<3000)
printf("符合預算n");
if (e+f>3000)
printf("超出預算n");
scanf("%d %d",&a,&b);
if (a==1)
e=2300;
if (a==2)
e=800;
if (a==3)
e=500;
if (a==4)
e=1500;
if (b==1)
f=2300;
if (b==2)
f=800;
if (b==3)
f=500;
if (b==4)
f=1500;
if (e+f<3000)
printf("符合預算n");
if (e+f>3000)
printf("超出預算n");
return 0;
}
[7]只選我要的
Page 67, 沈宏霖(10307)@1年3班
參考資料
[8]if的妙用
Page 68, 沈宏霖(10307)@1年3班
用if交換變數(C)(PDF) https://drive.google.com/file/d/1oYhfeBtVnxy3vwPpxRmuVaJ1LrkPqR26/preview
用if交換變數(C++)(PDF) https://drive.google.com/file/d/1yqTUfGUXdVDFjREuBsw4qyaaYA1oMBfV/preview
總結
[8]if的妙用
Page 68, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 比大小 30.0 30.0 1 2020/11/25 上午 06:54:07
2 三數比大小 30.0 30.0 7 2020/11/25 下午 01:39:44
3 五數比大小 40.0 40.0 1 2020/11/25 下午 01:42:57
4 自主學習 5.0 5.0 1 2020/11/25 下午 01:43:44
105 105
1. 比大小
Score: 30.0 Lang: c
Student Answer:
Score Times Completed Time
30.0 1 2020/11/25 上午 06:54:07
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
int a,b,max;
cin>>a>>b;
max=a;
if(b>max){
max=b;
}
cout<<"最大值"<<max<<endl;
/*第二輪判斷*/
cin>>a>>b;
max=a;
if(b>max){
max=b;
}
cout<<"最大值"<<max<<endl;
return 0;
}
[8]if的妙用
Page 70, 沈宏霖(10307)@1年3班
2. 三數比大小
Score: 30.0 Lang: c
Student Answer:
Score Times Completed Time
30.0 7 2020/11/25 下午 01:39:44
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
int a,b,c,max,min;
cin>>a>>b>>c;
max=a;
if(b>max){
max=b;
}
if(c>max){
max=c;
}
cout<<"最大值"<<max<<endl;
min=a;
if(min>b){
min=b;
}
if(min>c){
min=c;
}
cout<<"最小值"<<min<<endl;
/*第二輪判斷*/
cin>>a>>b>>c;
max=a;
if(b>max){
max=b;
}
if(c>max){
max=c;
}
cout<<"最大值"<<max<<endl;
min=a;
if(min>b){
min=b;
}
if(min>c){
min=c;
}
cout<<"最小值"<<min<<endl;
return 0;
}
[8]if的妙用
Page 72, 沈宏霖(10307)@1年3班
3. 五數比大小
Score: 40.0 Lang: c
Student Answer:
Score Times Completed Time
40.0 1 2020/11/25 下午 01:42:57
Language Code
C++ #include <iostream>
using namespace std;
int main()
{
int a,b,c,d,e,max,min;
cin>>a>>b>>c>>d>>e;
max=a;
if(b>max){
max=b;
}
if(c>max){
max=c;
}
if(d>max){
max=d;
}
if(e>max){
max=e;
}
cout<<"最大值"<<max<<endl;
min=a;
if(min>b){
min=b;
}
if(min>c){
min=c;
}
if(min>d){
min=d;
}
if(min>e){
min=e;
}
cout<<"最小值"<<min<<endl;
return 0;
}
[8]if的妙用
Page 74, 沈宏霖(10307)@1年3班
4. 自主學習
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
5.0 1 2020/11/25 下午 01:43:44
Language Code
C++ #include <stdio.h>
#include <stdlib.h>
int main()
{
int leap;
int year;
scanf("%d", &year);
if (0 == year % 4)
{
if (0 != year % 100)
{
leap = 1;
}
else
{
if (0 == year % 400)
{
leap = 1;
}
else
{
leap = 0;
}
}
}
else
{
leap = 0;
}
if (0 == leap)
{
printf("平年n");
}
else
{
printf("閏年n");
}
scanf("%d", &year);
if (0 == year % 4)
{
if (0 != year % 100)
{
leap = 1;
}
else
{
if (0 == year % 400)
{
leap = 1;
}
[8]if的妙用
Page 76, 沈宏霖(10307)@1年3班
else
{
leap = 0;
}
}
}
else
{
leap = 0;
}
if (0 == leap)
{
printf("平年n");
}
else
{
printf("閏年n");
}
scanf("%d", &year);
if (0 == year % 4)
{
if (0 != year % 100)
{
leap = 1;
}
else
{
if (0 == year % 400)
{
leap = 1;
}
else
{
leap = 0;
}
}
}
else
{
leap = 0;
}
if (0 == leap)
{
printf("平年n");
}
else
{
printf("閏年n");
}
scanf("%d", &year);
if (0 == year % 4)
{
if (0 != year % 100)
[8]if的妙用
Page 77, 沈宏霖(10307)@1年3班
{
leap = 1;
}
else
{
if (0 == year % 400)
{
leap = 1;
}
else
{
leap = 0;
}
}
}
else
{
leap = 0;
}
if (0 == leap)
{
printf("平年n");
}
else
{
printf("閏年n");
}
return 0;
}
[8]if的妙用
Page 78, 沈宏霖(10307)@1年3班
參考資料
[9]else魔法
Page 79, 沈宏霖(10307)@1年3班
二分選擇(C)(PDF) https://drive.google.com/file/d/1tbGJYWmghxQ89vEoocZ7lhNYzKcSFN1i/preview
二分選擇(C++)(PDF) https://drive.google.com/file/d/16Kd-LoL7rNB1rJtdSer08PpCf4_D70md/preview
總結
[9]else魔法
Page 79, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 奇數還是偶數? 15.0 15.0 1 2020/12/16 上午 06:47:05
2 是否能構成三角形? 15.0 15.0 9 2020/12/16 上午 07:19:07
3 是否直角三角形? 15.0 15.0 3 2020/12/18 下午 12:02:38
4 是否與7相關? 15.0 15.0 1 2020/12/18 下午 12:08:42
5 是否為3的倍數-1? 10.0 10.0 1 2020/12/18 下午 12:11:17
6 是否為3的倍數-2? 10.0 10.0 4 2021/1/5 下午 12:48:29
7 是否為迴文? 20.0 20.0 1 2020/12/18 下午 12:23:46
8 自主學習 5.0 5.0 1 2020/12/18 下午 12:27:37
105 105
1. 奇數還是偶數?
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 1 2020/12/16 上午 06:47:05
Language Code
C++ /*9_1.else魔法-奇數還是偶數?(15.0)*/
#include <iostream>
using namespace std;
int main()
{
int num;/*宣告整數變數*/
cin>>num;/*輸入整數變數*/
if(num%2==0){/*判斷n的餘數是否為0*/
cout<<num<<"是偶數"<<endl;
}
else{/*二分法*/
cout<<num<<"是奇數"<<endl;
}
/*第二輪判斷*/
cin>>num;/*輸入整數變數*/
if(num%2==0){/*判斷n的餘數是否為0*/
cout<<num<<"是偶數"<<endl;
}
else{/*二分法*/
cout<<num<<"是奇數"<<endl;
}
return 0;
}
[9]else魔法
Page 81, 沈宏霖(10307)@1年3班
2. 是否能構成三角形?
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 9 2020/12/16 上午 07:19:07
Language Code
C++ /*9_2.else魔法-是否能構成三角形?(15.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b>>c;
if(a+b>c && a+c>b && b+c>a)
{
cout<<a<<" "<<b<<" "<<c<<"可以構成三角形"<<endl;
}
else
{
cout<<a<<" "<<b<<" "<<c<<"不可以構成三角形"<<endl;
}
cin>>a>>b>>c;
if(a+b>c && a+c>b && b+c>a)
{
cout<<a<<" "<<b<<" "<<c<<"可以構成三角形"<<endl;
}
else
{
cout<<a<<" "<<b<<" "<<c<<"不可以構成三角形"<<endl;
}
return 0;
}
[9]else魔法
Page 83, 沈宏霖(10307)@1年3班
3. 是否直角三角形?
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 3 2020/12/18 下午 12:02:38
Language Code
C++ /*9_3.else魔法-是否直角三角形?(15.0)*/
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin>>a>>b>>c;
//判斷是否滿足三角形條件:兩邊之和是否大於第三邊;
if (a + b > c&&b + c > a&&a + c > a){
//判斷是否有兩邊的平方和大於第三邊的平方;
if ((a*a + b*b == c*c) || (a*a + c*c == b*b) || (b*b + c*c == a*a))
{
cout<<"直角三角形"<<endl;
}
else{
cout<<"不是直角三角形"<<endl;
}
}
cin>>a>>b>>c;
//判斷是否滿足三角形條件:兩邊之和是否大於第三邊;
if (a + b > c&&b + c > a&&a + c > a){
//判斷是否有兩邊的平方和大於第三邊的平方;
if ((a*a + b*b == c*c) || (a*a + c*c == b*b) || (b*b + c*c == a*a))
{
cout<<"直角三角形"<<endl;
}
else{
cout<<"不是直角三角形"<<endl;
}
}
return 0;
}
[9]else魔法
Page 85, 沈宏霖(10307)@1年3班
4. 是否與7相關?
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 1 2020/12/18 下午 12:08:42
Language Code
C++ /*9_4.else魔法-是否與7相關?(15.0)*/
#include <iostream>
using namespace std;
int main() {
int n,x,y;
cin>>n;
x=n%7;
y=n/1%10;
if(x==0||y==7)
{
cout<<n<<"符合標準"<<endl;
}
else
{
cout<<n<<"不符合標準"<<endl;
}
cin>>n;
x=n%7;
y=n/1%10;
if(x==0||y==7)
{
cout<<n<<"符合標準"<<endl;
}
else
{
cout<<n<<"不符合標準"<<endl;
}
cin>>n;
x=n%7;
y=n/1%10;
if(x==0||y==7)
{
cout<<n<<"符合標準"<<endl;
}
else
{
cout<<n<<"不符合標準"<<endl;
}
return 0;
}
[9]else魔法
Page 87, 沈宏霖(10307)@1年3班
5. 是否為3的倍數-1?
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 1 2020/12/18 下午 12:11:17
Language Code
C++ /*9_5.else魔法-是否為3的倍數-1?(10.0)*/
#include <iostream>
using namespace std;
int main() {
int a;
cin>>a;
cout<<a/100%10<<endl;
cout<<a/10%10<<endl;
cout<<a/1%10<<endl;
return 0;
}
[9]else魔法
Page 88, 沈宏霖(10307)@1年3班
6. 是否為3的倍數-2?
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 4 2021/1/5 下午 12:48:29
Language Code
C++ #include <stdio.h>
int main()
{
int a,b,c,d;
scanf("%d",&a);
b=a/100%10%3;
c=a/10%10%3;
d=a/1%10%3;
if(b==0)
printf("百位數%d是3的倍數n",a/100%10);
if(b!=0)
printf("百位數%d不是3的倍數n",a/100%10);
if(c==0)
printf("十位數%d是3的倍數n",a/10%10);
if(c!=0)
printf("十位數%d不是3的倍數n",a/10%10);
if(d==0)
printf("個位數%d是3的倍數n",a/1%10);
if(d!=0)
printf("個位數%d不是3的倍數n",a/1%10);
return 0;
}
[9]else魔法
Page 90, 沈宏霖(10307)@1年3班
7. 是否為迴文?
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/12/18 下午 12:23:46
Language Code
C++ /*9_7.else魔法-是否為迴文?(20.0)*/
#include <iostream>
using namespace std;
int main() {
int x,a,b,c,d,e;
cin>>x;
a=x/10000%10%3;
b=x/1000%10%3;
c=x/100%10%3;
d=x/10%10%3;
e=x/1%10%3;
if(a==e&&b==d)
cout<<x<<"是迴文"<<endl;
else
cout<<x<<"不是迴文"<<endl;
cin>>x;
a=x/10000%10%3;
b=x/1000%10%3;
c=x/100%10%3;
d=x/10%10%3;
e=x/1%10%3;
if(a==e&&b==d)
cout<<x<<"是迴文"<<endl;
else
cout<<x<<"不是迴文"<<endl;
return 0;
}
[9]else魔法
Page 92, 沈宏霖(10307)@1年3班
8. 自主學習
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
5.0 1 2020/12/18 下午 12:27:37
Language Code
C++ /*9_8.else魔法-自主學習(5.0)*/
#include <iostream>
using namespace std;
int main() {
int x,a=80,b=64,c=72;
cin>>x;
if(x==5)
cout<<a<<"分"<<endl;
if(x==7)
cout<<b<<"分"<<endl;
if(x==18)
cout<<c<<"分"<<endl;
else
cout<<"成績不存在"<<endl;
cin>>x;
if(x==5)
cout<<a<<"分"<<endl;
if(x==7)
cout<<b<<"分"<<endl;
if(x==18)
cout<<c<<"分"<<endl;
else
cout<<"成績不存在"<<endl;
return 0;
}
[9]else魔法
Page 94, 沈宏霖(10307)@1年3班
參考資料
[10]比較中有比較
Page 95, 沈宏霖(10307)@1年3班
巢狀比較(C)(PDF) https://drive.google.com/file/d/1zTO_1xpLYUmRh2SOs1sk-QY2sqymmu6b/preview
巢狀比較(C++)(PDF) https://drive.google.com/file/d/1YMq4WnIm8_9yXpgSQT3YEbsFKqBQfJwd/preview
總結
[10]比較中有比較
Page 95, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 分數等第 40.0 40.0 2 2020/12/30 上午 06:51:47
2 正三角形嗎? 30.0 30.0 7 2020/12/23 上午 07:17:00
3 玩玩二分法 30.0 30.0 1 2021/1/5 下午 12:44:25
4 自主學習 5.0 1.0 2 2021/1/5 下午 12:45:00
105 101
1. 分數等第
Score: 40.0 Lang: c
Student Answer:
Score Times Completed Time
40.0 2 2020/12/30 上午 06:51:47
Language Code
C++ #include <iostream>
int main()
{
int x;
std::cin>>x;
if (x>=90)std::cout<<"Your score is "<<x<<" and degree is A!n";
else if (x>=80)std::cout<<"Your score is "<<x<<" and degree is B!n";
else if (x>=70)std::cout<<"Your score is "<<x<<" and degree is C!n";
else if (x>=60)std::cout<<"Your score is "<<x<<" and degree is D!n";
else std::cout<<"Your score is "<<x<<" and degree is F!n";
std::cin>>x;
if (x>=90)std::cout<<"Your score is "<<x<<" and degree is A!n";
else if (x>=80)std::cout<<"Your score is "<<x<<" and degree is B!n";
else if (x>=70)std::cout<<"Your score is "<<x<<" and degree is C!n";
else if (x>=60)std::cout<<"Your score is "<<x<<" and degree is D!n";
else std::cout<<"Your score is "<<x<<" and degree is F!n";
std::cin>>x;
if (x>=90)std::cout<<"Your score is "<<x<<" and degree is A!n";
else if (x>=80)std::cout<<"Your score is "<<x<<" and degree is B!n";
else if (x>=70)std::cout<<"Your score is "<<x<<" and degree is C!n";
else if (x>=60)std::cout<<"Your score is "<<x<<" and degree is D!n";
else std::cout<<"Your score is "<<x<<" and degree is F!n";
return 0;
}
[10]比較中有比較
Page 97, 沈宏霖(10307)@1年3班
2. 正三角形嗎?
Score: 30.0 Lang: c
Student Answer:
Score Times Completed Time
30.0 7 2020/12/23 上午 07:17:00
Language Code
C++ /*10_2.比較中有比較-正三角形嗎?(30.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b>>c;
if((a+b>c)&&(b+c>a)&&(c+a>b))
{
if(a==b && b==c && c==a)
{
cout<<a<<" "<<b<<" "<<c<<"正三角形"<<endl;
}
else
{
cout<<a<<" "<<b<<" "<<c<<"非正三角形"<<endl;
}
}
else
{
cout<<a<<" "<<b<<" "<<c<<"無法構成三角形"<<endl;
}
cin>>a>>b>>c;
if((a+b>c)&&(b+c>a)&&(c+a>b))
{
if(a==b && b==c && c==a)
{
cout<<a<<" "<<b<<" "<<c<<"正三角形"<<endl;
}
else
{
cout<<a<<" "<<b<<" "<<c<<"非正三角形"<<endl;
}
}
else
{
cout<<a<<" "<<b<<" "<<c<<"無法構成三角形"<<endl;
}
cin>>a>>b>>c;
if((a+b>c)&&(b+c>a)&&(c+a>b))
{
if(a==b && b==c && c==a)
{
cout<<a<<" "<<b<<" "<<c<<"正三角形"<<endl;
}
else
{
cout<<a<<" "<<b<<" "<<c<<"非正三角形"<<endl;
}
}
else
[10]比較中有比較
Page 99, 沈宏霖(10307)@1年3班
{
cout<<a<<" "<<b<<" "<<c<<"無法構成三角形"<<endl;
}
return 0;
}
[10]比較中有比較
Page 100, 沈宏霖(10307)@1年3班
3. 玩玩二分法
Score: 30.0 Lang: c
Student Answer:
Score Times Completed Time
30.0 1 2021/1/5 下午 12:44:25
Language Code
C++ #include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
if (a>0)
{
printf("%d是正數n",a);
if (a<=10000)
printf("An");
else
printf("Bn");
}
if (a<0)
{
printf("%d是負數n",a);
if (a<=-10000)
printf("Cn");
else
printf("Dn");
}
scanf("%d",&a);
if (a>0)
{
printf("%d是正數n",a);
if (a<=10000)
printf("An");
else
printf("Bn");
}
if (a<0)
{
printf("%d是負數n",a);
if (a<=-10000)
printf("Cn");
else
printf("Dn");
}
scanf("%d",&a);
if (a>0)
{
printf("%d是正數n",a);
if (a<=10000)
printf("An");
else
printf("Bn");
}
if (a<0)
[10]比較中有比較
Page 102, 沈宏霖(10307)@1年3班
{
printf("%d是負數n",a);
if (a<=-10000)
printf("Cn");
else
printf("Dn");
}
return 0;
}
[10]比較中有比較
Page 103, 沈宏霖(10307)@1年3班
4. 自主學習
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
1.0 2 2021/1/5 下午 12:45:00
Language Code
C++ #include <stdio.h>
int main(){
char a;
scanf("%c",&a);
if (a>=65&&a<=90)
{
printf("大寫n");
}
else if (a>=97&&a<=122)
{
printf("小寫n");
}
else
{
printf("都不是n");
}
scanf("%c",&a);
if (a>=65&&a<=90)
{
printf("大寫n");
}
else if (a>=97&&a<=122)
{
printf("小寫n");
}
else
{
printf("都不是n");
}
scanf("%c",&a);
if (a>=65&&a<=90)
{
printf("大寫n");
}
else if (a>=97&&a<=122)
{
printf("小寫n");
}
else
{
printf("都不是n");
}
scanf("%c",&a);
if (a>=65&&a<=90)
{
printf("大寫n");
}
[10]比較中有比較
Page 105, 沈宏霖(10307)@1年3班
else if (a>=97&&a<=122)
{
printf("小寫n");
}
else
{
printf("都不是n");
}
scanf("%c",&a);
if (a>=65&&a<=90)
{
printf("大寫n");
}
else if (a>=97&&a<=122)
{
printf("小寫n");
}
else
{
printf("都不是n");
}
return 0;
}
[10]比較中有比較
Page 106, 沈宏霖(10307)@1年3班
參考資料
[11]多選一
Page 107, 沈宏霖(10307)@1年3班
多選一(C)(PDF) https://drive.google.com/file/d/1i-ASUt_r2YEtdAuyRorCTDsx7oLYHAnK/preview
多選一(C++)(PDF) https://drive.google.com/file/d/1TPp2kokF7IH6Ysc3TfhEOSd5iAxVcGlS/preview
總結
[11]多選一
Page 107, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 分數等第 15.0 15.0 2 2020/12/30 上午 07:04:34
2 年齡說 15.0 15.0 9 2021/1/13 下午 01:14:51
3 薪資計算 15.0 15.0 2 2021/1/5 下午 01:13:51
4 月份判斷 15.0 0.0 15 2021/1/15 下午 02:04:23
5 三角形型別 15.0 10.512820482254028 1 2021/1/5 下午 01:40:20
6 BMI-1 15.0 15.0 3 2021/1/5 下午 01:55:41
7 BMI-2 5.0 5.0 2 2021/1/5 下午 02:07:54
8 BMI-3 5.0 3.333333333333333 1 2021/1/5 下午 02:09:10
9 自主學習 5.0 5.0 1 2021/1/5 下午 01:40:59
105 83
1. 分數等第
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 2 2020/12/30 上午 07:04:34
Language Code
C++ /*11_1.多選一-分數等第(15.0)*/
#include <iostream>
using namespace std;
int main() {
int a;
std::cin>>a;
if(a>=0&&a<=100){
if(a>=90)std::cout<<"Your score is "<<a<<" and degree is A!n";
else if (a>=80)std::cout<<"Your score is "<<a<<" and degree is
B!n";
else if (a>=70)std::cout<<"Your score is "<<a<<" and degree is
C!n";
else if (a>=60)std::cout<<"Your score is "<<a<<" and degree is
D!n";
else std::cout<<"Your score is "<<a<<" and degree is F!n";
}
std::cin>>a;
if(a>=0&&a<=100){
if(a>=90)std::cout<<"Your score is "<<a<<" and degree is A!n";
else if (a>=80)std::cout<<"Your score is "<<a<<" and degree is
B!n";
else if (a>=70)std::cout<<"Your score is "<<a<<" and degree is
C!n";
else if (a>=60)std::cout<<"Your score is "<<a<<" and degree is
D!n";
else std::cout<<"Your score is "<<a<<" and degree is F!n";
}
std::cin>>a;
if(a>=0&&a<=100){
if(a>=90)std::cout<<"Your score is "<<a<<" and degree is A!n";
else if (a>=80)std::cout<<"Your score is "<<a<<" and degree is
B!n";
else if (a>=70)std::cout<<"Your score is "<<a<<" and degree is
C!n";
else if (a>=60)std::cout<<"Your score is "<<a<<" and degree is
D!n";
else std::cout<<"Your score is "<<a<<" and degree is F!n";
}
return 0;
}
[11]多選一
Page 109, 沈宏霖(10307)@1年3班
2. 年齡說
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 9 2021/1/13 下午 01:14:51
Language Code
C++ /*11_2.多選一-年齡說(15.0)*/
#include <iostream>
using namespace std;
int main() {
int a;
std::cin>>a;
if (a<100&&a>0){
if (a>=70)std::cout<<a<<"歲是從心所欲,不逾矩之年n";
else if (a>=60)std::cout<<a<<"歲是耳順之年n";
else if (a>=50)std::cout<<a<<"歲是知天命之年n";
else if (a>=40)std::cout<<a<<"歲是不惑之年n";
else if (a>=30)std::cout<<a<<"歲是而立之年n";
else if (a>=15)std::cout<<a<<"歲是志於學n";
else std::cout<<a<<"歲是小孩子n";
}
std::cin>>a;
if (a<100&&a>0){
if (a>=70)std::cout<<a<<"歲是從心所欲,不逾矩之年n";
else if (a>=60)std::cout<<a<<"歲是耳順之年n";
else if (a>=50)std::cout<<a<<"歲是知天命之年n";
else if (a>=40)std::cout<<a<<"歲是不惑之年n";
else if (a>=30)std::cout<<a<<"歲是而立之年n";
else if (a>=15)std::cout<<a<<"歲是志於學n";
else std::cout<<a<<"歲是小孩子n";
}
std::cin>>a;
if (a<100&&a>0){
if (a>=70)std::cout<<a<<"歲是從心所欲,不逾矩之年n";
else if (a>=60)std::cout<<a<<"歲是耳順之年n";
else if (a>=50)std::cout<<a<<"歲是知天命之年n";
else if (a>=40)std::cout<<a<<"歲是不惑之年n";
else if (a>=30)std::cout<<a<<"歲是而立之年n";
else if (a>=15)std::cout<<a<<"歲是志於學n";
else std::cout<<a<<"歲是小孩子n";
}
return 0;
}
[11]多選一
Page 111, 沈宏霖(10307)@1年3班
3. 薪資計算
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 2 2021/1/5 下午 01:13:51
Language Code
C++ #include <stdio.h>
int main()
{
int x;
float y;
scanf("%d",&x);
if (x<=60)
{
printf ("%dn",x*75);
}
else if (x>60&&x<=75)
{
printf ("%gn",60*75+(x-60)*75*1.25);
}
else
{
printf ("%gn",60*75+15*75*1.25+(x-75)*75*1.75);
}
return 0;
}
[11]多選一
Page 113, 沈宏霖(10307)@1年3班
4. 月份判斷
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
0.0 15 2021/1/15 下午 02:04:23
Language Code
C++ /*11_4.多選一-月份判斷(15.0)*/
#include <iostream>
using namespace std;
int main() {
int a;
std::cin>>a;
if(a=1&&a<13){
if (a=1)std::cout<<a<<"月是冬天n";
else if (a=2)std::cout<<a<<"月是冬天n";
else if (a=3)std::cout<<a<<"月是春天n";
else if (a=4)std::cout<<a<<"月是春天n";
else if (a=5)std::cout<<a<<"月是春天n";
else if (a=6)std::cout<<a<<"月是夏天n";
else if (a=7)std::cout<<a<<"月是夏天n";
else if (a=8)std::cout<<a<<"月是夏天n";
else if (a=9)std::cout<<a<<"月是秋天n";
else if (a=10)std::cout<<a<<"月是秋天n";
else if (a=11)std::cout<<a<<"月是秋天n";
else if (a=12)std::cout<<a<<"月是冬天n";
else std::cout<<"超出範圍n";
}
return 0;
}
[11]多選一
Page 115, 沈宏霖(10307)@1年3班
5. 三角形型別
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
10.512820482254028 1 2021/1/5 下午 01:40:20
Language Code
C++ #include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int a, b, c;
int s, area;
scanf("%d %d %d", &a, &b, &c);
//判斷是否滿足三角形條件:兩邊之和是否大於第三邊;
if (a + b > c&&b + c > a&&a + c > a)
{
//判斷三條邊是否相等;
if (a == b&&a == c)
{
printf("%d %d %d正三角形n",a, b, c);
}
//判斷三角形是否有兩天邊相等;
else if (a == b || a == c || b == c)
{
printf("%d %d %d等腰三角形n",a, b, c);
}
//判斷是否有兩邊的平方和大於第三邊的平方;
else
{
printf("%d %d %d直角三角形n",a, b, c);
}
}
else
{
printf("%d %d %d無法構成三角形n",a, b, c);
}
scanf("%d %d %d", &a, &b, &c);
scanf("%d %d %d", &a, &b, &c);
//判斷是否滿足三角形條件:兩邊之和是否大於第三邊;
if (a + b > c&&b + c > a&&a + c > a)
{
//判斷三條邊是否相等;
if (a == b&&a == c)
{
printf("%d %d %d正三角形n",a, b, c);
}
//判斷三角形是否有兩天邊相等;
else if (a == b || a == c || b == c)
{
printf("%d %d %d等腰三角形n",a, b, c);
}
//判斷是否有兩邊的平方和大於第三邊的平方;
else
{
printf("%d %d %d直角三角形n",a, b, c);
[11]多選一
Page 117, 沈宏霖(10307)@1年3班
}
}
else
{
printf("%d %d %d無法構成三角形n",a, b, c);
}
scanf("%d %d %d", &a, &b, &c);
scanf("%d %d %d", &a, &b, &c);
//判斷是否滿足三角形條件:兩邊之和是否大於第三邊;
if (a + b > c&&b + c > a&&a + c > a)
{
//判斷三條邊是否相等;
if (a == b&&a == c)
{
printf("%d %d %d正三角形n",a, b, c);
}
//判斷三角形是否有兩天邊相等;
else if (a == b || a == c || b == c)
{
printf("%d %d %d等腰三角形n",a, b, c);
}
//判斷是否有兩邊的平方和大於第三邊的平方;
else
{
printf("%d %d %d直角三角形n",a, b, c);
}
}
else
{
printf("%d %d %d無法構成三角形n",a, b, c);
}
scanf("%d %d %d", &a, &b, &c);
return 0;
}
[11]多選一
Page 118, 沈宏霖(10307)@1年3班
6. BMI-1
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 3 2021/1/5 下午 01:55:41
Language Code
C++ #include <stdio.h>
int main()
{
int kg;
float m,bmi;
scanf("%dn%f",&kg,&m);
bmi=kg/(m*m);
if (bmi>18.5&&bmi<=24)
{
printf("BMI=%.6fn你的體重在正常範圍n",bmi);
}
else
{
printf("BMI=%.6fn你的體重不標準n",bmi);
}
return 0;
}
[11]多選一
Page 120, 沈宏霖(10307)@1年3班
7. BMI-2
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
5.0 2 2021/1/5 下午 02:07:54
Language Code
C++ #include <stdio.h>
int main()
{
int kg;
float m,bmi;
scanf("%dn%f",&kg,&m);
bmi=kg/(m*m);
if (bmi<18.5)
{
printf("BMI=%.2fn你的體重太輕n",bmi);
}
else if (bmi>=18.5&&bmi<24)
{
printf("BMI=%.2fn你的體重在正常範圍n",bmi);
}
else if (bmi>=24&&bmi<27)
{
printf("BMI=%.2fn你的體重過重n",bmi);
}
else if (bmi>=27&&bmi<30)
{
printf("BMI=%.2fn輕度肥胖n",bmi);
}
else if (bmi>=30&&bmi<35)
{
printf("BMI=%.2fn中度肥胖n",bmi);
}
else
{
printf("BMI=%.2fn重度肥胖n",bmi);
}
return 0;
}
[11]多選一
Page 122, 沈宏霖(10307)@1年3班
8. BMI-3
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
3.333333333333333 1 2021/1/5 下午 02:09:10
Language Code
C++ #include <stdio.h>
int main()
{
int kg,g;
float m,bmi;
scanf("%dn%dn%f",&g,&kg,&m);
bmi=kg/(m*m);
if (g==1)
{
printf("男生nBMI=%.1fn",bmi);
if (bmi>=20&&bmi<25)
{
printf("標準範圍n");
}
else if (bmi<20)
{
printf("體重太輕n");
}
else if (bmi>=25)
{
printf("體重太重n");
}
}
if (g==0)
{
printf("女生nBMI=%.1fn",bmi);
if (bmi>=18&&bmi<22)
{
printf("標準範圍n");
}
else if (bmi<18)
{
printf("體重太輕n");
}
else if (bmi>=22)
{
printf("體重太重n");
}
}
return 0;
}
[11]多選一
Page 124, 沈宏霖(10307)@1年3班
9. 自主學習
Score: 5.0 Lang: c
Student Answer:
Score Times Completed Time
5.0 1 2021/1/5 下午 01:40:59
Language Code
C++ #include <stdio.h>
#include <stdlib.h>
int main()
{
int leap;
int year;
scanf("%d", &year);
if (0 == year % 4)
{
if (0 != year % 100)
{
leap = 1;
}
else
{
if (0 == year % 400)
{
leap = 1;
}
else
{
leap = 0;
}
}
}
else
{
leap = 0;
}
if (0 == leap)
{
printf("平年n");
}
else
{
printf("閏年n");
}
scanf("%d", &year);
if (0 == year % 4)
{
if (0 != year % 100)
{
leap = 1;
}
else
{
if (0 == year % 400)
{
leap = 1;
[11]多選一
Page 126, 沈宏霖(10307)@1年3班
}
else
{
leap = 0;
}
}
}
else
{
leap = 0;
}
if (0 == leap)
{
printf("平年n");
}
else
{
printf("閏年n");
}
scanf("%d", &year);
if (0 == year % 4)
{
if (0 != year % 100)
{
leap = 1;
}
else
{
if (0 == year % 400)
{
leap = 1;
}
else
{
leap = 0;
}
}
}
else
{
leap = 0;
}
if (0 == leap)
{
printf("平年n");
}
else
{
printf("閏年n");
}
scanf("%d", &year);
[11]多選一
Page 127, 沈宏霖(10307)@1年3班
if (0 == year % 4)
{
if (0 != year % 100)
{
leap = 1;
}
else
{
if (0 == year % 400)
{
leap = 1;
}
else
{
leap = 0;
}
}
}
else
{
leap = 0;
}
if (0 == leap)
{
printf("平年n");
}
else
{
printf("閏年n");
}
scanf("%d", &year);
if (0 == year % 4)
{
if (0 != year % 100)
{
leap = 1;
}
else
{
if (0 == year % 400)
{
leap = 1;
}
else
{
leap = 0;
}
}
}
else
{
leap = 0;
[11]多選一
Page 128, 沈宏霖(10307)@1年3班
}
if (0 == leap)
{
printf("平年n");
}
else
{
printf("閏年n");
}
return 0;
}
[11]多選一
Page 129, 沈宏霖(10307)@1年3班
參考資料
[32]109上第1次上機考(B)
Page 130, 沈宏霖(10307)@1年3班
2.輸出函數(PDF
)
http://210.60.224.1/~goodnice418/dice/2-%E8%BC%B8%E5%87%BA%E5%87%BD%E6%95%B8.pdf
3.變數與指定運
算子(PDF)
http://210.60.224.1/~goodnice418/dice/3-%E8%AE%8A%E6%95%B8%E8%88%87%E6%8C%87%E5%AE%9A%E9
4. 加法(PDF) http://210.60.224.1/~goodnice418/dice/4-%E5%8A%A0%E6%B3%95.pdf
5. 變數與輸入
函數(PDF)
http://210.60.224.1/~goodnice418/dice/5-%E8%AE%8A%E6%95%B8%E8%88%87%E8%BC%B8%E5%85%A5%E5
6.運算子(PDF) http://210.60.224.1/~goodnice418/dice/6-%E9%81%8B%E7%AE%97%E5%AD%90.pdf
總結
[32]109上第1次上機考(B)
Page 130, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 我要Pass 20.0 20.0 1 2020/11/25 上午 06:25:03
2 今夕是何年? 20.0 20.0 1 2020/11/25 上午 06:26:48
3 三角形面積 20.0 20.0 1 2020/11/25 上午 06:28:47
4 溫度換算 20.0 20.0 1 2020/11/25 上午 06:38:26
5 圓周長與面積 20.0 20.0 3 2020/11/25 上午 06:44:31
6 搶購iPhone12 15.0 15.0 1 2020/11/25 上午 06:47:51
115 115
1. 我要Pass
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/11/25 上午 06:25:03
Language Code
C++ /*31_p_1.109上第1次上機考(B)-我要Pass(20.0)*/
#include <iostream>
using namespace std;
int main() {
cout<<"我要Pass!"<<endl;
cout<<"我要Pass!"<<endl;
cout<<"我要Pass!"<<endl;
return 0;
}
[32]109上第1次上機考(B)
Page 131, 沈宏霖(10307)@1年3班
2. 今夕是何年?
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/11/25 上午 06:26:48
Language Code
C++ /*31_p_2.109上第1次上機考(B)-今夕是何年?(20.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b;
cin>>a;
b=a+1911;
cout<<b<<endl;
return 0;
}
[32]109上第1次上機考(B)
Page 132, 沈宏霖(10307)@1年3班
3. 三角形面積
Score: 20.0 Lang: {}
Student Answer:
Score Times Completed Time
20.0 1 2020/11/25 上午 06:28:47
Language Code
C++ /*31_p_3.109上第1次上機考(B)-三角形面積(20.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b;
c=(a*b)/2;
cout<<"三角形面積="<<c<<"平方公分"<<endl;
return 0;
}
[32]109上第1次上機考(B)
Page 133, 沈宏霖(10307)@1年3班
4. 溫度換算
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/11/25 上午 06:38:26
Language Code
C++ /*31_p_4.109上第1次上機考(B)-溫度換算(20.0)*/
#include <iostream>
#include<iomanip>
using namespace std;
int main() {
int a,b,c;
float a1,b1,c1;
cin>>a>>b>>c;
a1=(a-32)*5.0/9.0;
cout<<"1.攝氏溫度為"<<fixed<<setprecision(1)<<a1<<endl;
b1=(b-32)*5.0/9.0;
cout<<"2.攝氏溫度為"<<fixed<<setprecision(1)<<b1<<endl;
c1=(c-32)*5.0/9.0;
cout<<"3.攝氏溫度為"<<fixed<<setprecision(1)<<c1<<endl;
return 0;
}
[32]109上第1次上機考(B)
Page 134, 沈宏霖(10307)@1年3班
5. 圓周長與面積
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 3 2020/11/25 上午 06:44:31
Language Code
C++ /*31_p_5.109上第1次上機考(B)-圓周長與面積(20.0)*/
#include <iostream>
#include<iomanip>
using namespace std;
int main() {
int a,b;
float c,d,e;
cin>>a>>b;
c=(a*2)*3.14;
cout<<"圓周長為"<<fixed<<setprecision(2)<<c<<endl;
d=(a*a)*3.14;
cout<<"圓面積為"<<fixed<<setprecision(2)<<d<<endl;
e=((a*a)*3.14)*45.0/360.0;
cout<<"扇形面積為"<<fixed<<setprecision(2)<<e<<endl;
return 0;
}
[32]109上第1次上機考(B)
Page 135, 沈宏霖(10307)@1年3班
6. 搶購iPhone12
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 1 2020/11/25 上午 06:47:51
Language Code
C++ /*31_p_6.109上第1次上機考(B)-搶購iPhone12(15.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c,d;
cin>>a>>b;
c=(a*60)+b;
d=c/80;
cout<<d<<"支"<<endl;
return 0;
}
[32]109上第1次上機考(B)
Page 136, 沈宏霖(10307)@1年3班
參考資料
[33]109上第1次上機考(B)(複習)
Page 137, 沈宏霖(10307)@1年3班
- -
總結
[33]109上第1次上機考(B)(複習)
Page 137, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 我要Pass 20.0 20.0 1 2020/12/9 上午 06:53:24
2 今夕是何年? 20.0 20.0 1 2020/12/9 上午 06:54:50
3 三角形面積 20.0 20.0 1 2020/12/9 上午 07:05:23
4 溫度換算 20.0 20.0 6 2020/12/10 下午 12:40:30
5 圓周長與面積 20.0 20.0 1 2020/12/10 下午 12:40:18
6 搶購iPhone12 15.0 15.0 1 2020/12/10 下午 12:43:11
115 115
1. 我要Pass
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/12/9 上午 06:53:24
Languag
e
Code
C++ /*bd681fa1fdc340f1927dc8ba052667e6_1.109上第1次上機考(B)(複習)-我要Pa
ss(20.0)*/
#include <iostream>
using namespace std;
int main() {
cout<<"我要Pass!"<<endl;
cout<<"我要Pass!"<<endl;
cout<<"我要Pass!"<<endl;
return 0;
}
[33]109上第1次上機考(B)(複習)
Page 138, 沈宏霖(10307)@1年3班
2. 今夕是何年?
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/12/9 上午 06:54:50
Langua
ge
Code
C++ /*bd681fa1fdc340f1927dc8ba052667e6_2.109上第1次上機考(B)(複習)-今夕是
何年?(20.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b;
cin>>a;
b=a+1911;
cout<<b<<endl;
return 0;
}
[33]109上第1次上機考(B)(複習)
Page 139, 沈宏霖(10307)@1年3班
3. 三角形面積
Score: 20.0 Lang: {}
Student Answer:
Score Times Completed Time
20.0 1 2020/12/9 上午 07:05:23
Langua
ge
Code
C++ /*bd681fa1fdc340f1927dc8ba052667e6_3.109上第1次上機考(B)(複習)-三角形
面積(20.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b;
c=(a*b)/2;
cout<<"三角形面積="<<c<<"平方公分"<<endl;
return 0;
}
[33]109上第1次上機考(B)(複習)
Page 140, 沈宏霖(10307)@1年3班
4. 溫度換算
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 6 2020/12/10 下午 12:40:30
Language Code
C++ #include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int a,b,c;
float num1,num2,num3;/*宣告二個整數變數*/
cin>>a>>b>>c;/*輸入兩個整數變數*/
num1=(5.0/9.0)*(a-32);
cout<<"1.攝氏溫度為"<<fixed<<setprecision(1)<<num1<<endl;
num2=(5.0/9.0)*(b-32);
cout<<"2.攝氏溫度為"<<fixed<<setprecision(1)<<num2<<endl;
num3=(5.0/9.0)*(c-32);
cout<<"3.攝氏溫度為"<<fixed<<setprecision(1)<<num3<<endl;
return 0;
}
[33]109上第1次上機考(B)(複習)
Page 141, 沈宏霖(10307)@1年3班
5. 圓周長與面積
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2020/12/10 下午 12:40:18
Langua
ge
Code
C++ /*bd681fa1fdc340f1927dc8ba052667e6_5.109上第1次上機考(B)(複習)-圓周長
與面積(20.0)*/
#include <iostream>
#include<iomanip>
using namespace std;
int main() {
int a,b;
float c,d,e;
cin>>a>>b;
c=2*a*3.14;
d=(a*a)*3.14;
e=((a*a)*3.14)*(b/360.00);
cout<<"圓周長為"<<fixed<<setprecision(2)<<c<<endl;
cout<<"圓面積為"<<fixed<<setprecision(2)<<d<<endl;
cout<<"扇形面積為"<<fixed<<setprecision(2)<<e<<endl;
return 0;
}
[33]109上第1次上機考(B)(複習)
Page 142, 沈宏霖(10307)@1年3班
6. 搶購iPhone12
Score: 15.0 Lang: c
Student Answer:
Score Times Completed Time
15.0 1 2020/12/10 下午 12:43:11
Langua
ge
Code
C++ /*bd681fa1fdc340f1927dc8ba052667e6_6.109上第1次上機考(B)(複習)-搶購iPh
one12(15.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c,d,n1;
cin>>a>>b;
c=a*60;
d=c+b;
n1=d/80;
cout<<n1<<"支"<<endl;
return 0;
}
[33]109上第1次上機考(B)(複習)
Page 143, 沈宏霖(10307)@1年3班
參考資料
[34]109上第2次上機考
Page 144, 沈宏霖(10307)@1年3班
2-輸出函數(PDF) http://210.60.224.1/~goodnice418/dice/2-%E8%BC%B8%E5%87%BA%E5%87%BD%E6%95%B8.pdf
3-變數與指定運
算子(PDF)
http://210.60.224.1/~goodnice418/dice/3-‹Šex‚c[š•K{—[P.pdf
4. 加法(PDF) http://210.60.224.1/~goodnice418/dice/4-%E5%8A%A0%E6%B3%95.pdf
5. 變數與輸入函
數(PDF)
http://210.60.224.1/~goodnice418/dice/5-%E8%AE%8A%E6%95%B8%E8%88%87%E8%BC%B8%E5%85%A5%
6.運算子(PDF) http://210.60.224.1/~goodnice418/dice/6-%E9%81%8B%E7%AE%97%E5%AD%90.pdf
7-單一選擇(PDF) http://210.60.224.1/~goodnice418/dice/7-U®N•xdÇ.pdf
8-用if交換變數(P
DF)
http://210.60.224.1/~goodnice418/dice/8-u(ifN¤cÛ‹Šex.pdf
9-二分法(PDF) http://210.60.224.1/~goodnice418/dice/9-NŒRlÕ.pdf
10-巢狀比較(PDF
)
http://210.60.224.1/~goodnice418/dice/10-]ârÀkÔ•.pdf
總結
[34]109上第2次上機考
Page 144, 沈宏霖(10307)@1年3班
# 名稱 配分 得分 次數 時間
1 三角形面積 10.0 10.0 1 2021/1/6 上午 06:24:51
2 溫度換算 10.0 10.0 1 2021/1/6 上午 06:29:29
3 時間換算 10.0 10.0 1 2021/1/6 上午 06:30:55
4 圓周長與面積 20.0 20.0 1 2021/1/6 上午 06:34:47
5 奇數還是偶數? 20.0 20.0 2 2021/1/6 上午 06:38:24
6 遊樂場週年慶 20.0 20.0 1 2021/1/6 上午 06:42:20
7 四數比大小 30.0 0.0 2 2021/1/6 上午 07:10:53
8 俱樂部會員等級 30.0 30.0 5 2021/1/6 上午 07:09:43
150 120
1. 三角形面積
Score: 10.0 Lang: {}
Student Answer:
Score Times Completed Time
10.0 1 2021/1/6 上午 06:24:51
Languag
e
Code
C++ /*50c4a199c60c4f15a7098e19ce790c78_1.109上第2次上機考-三角形面積(10.
0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b;
c=(a*b)/2;
cout<<"三角形面積="<<c<<"平方公分"<<endl;
return 0;
}
[34]109上第2次上機考
Page 145, 沈宏霖(10307)@1年3班
2. 溫度換算
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 1 2021/1/6 上午 06:29:29
Languag
e
Code
C++ /*50c4a199c60c4f15a7098e19ce790c78_2.109上第2次上機考-溫度換算(10.0)
*/
#include <iostream>
#include<iomanip>
using namespace std;
int main() {
int a,b,c;
float d,e,f;
cin>>a>>b>>c;
d=(5.0/9.0)*(a-32);
e=(5.0/9.0)*(b-32);
f=(5.0/9.0)*(c-32);
cout<<"1.攝氏溫度為"<<fixed<<setprecision(1)<<d<<endl;
cout<<"2.攝氏溫度為"<<fixed<<setprecision(1)<<e<<endl;
cout<<"3.攝氏溫度為"<<fixed<<setprecision(1)<<f<<endl;
return 0;
}
[34]109上第2次上機考
Page 146, 沈宏霖(10307)@1年3班
3. 時間換算
Score: 10.0 Lang: c
Student Answer:
Score Times Completed Time
10.0 1 2021/1/6 上午 06:30:55
Languag
e
Code
C++ /*50c4a199c60c4f15a7098e19ce790c78_3.109上第2次上機考-時間換算(10.0)
*/
#include <iostream>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b;
c=(a*60)+b;
cout<<c<<"分鐘"<<endl;
return 0;
}
[34]109上第2次上機考
Page 147, 沈宏霖(10307)@1年3班
4. 圓周長與面積
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2021/1/6 上午 06:34:47
Languag
e
Code
C++ /*50c4a199c60c4f15a7098e19ce790c78_4.109上第2次上機考-圓周長與面積(2
0.0)*/
#include <iostream>
#include<iomanip>
using namespace std;
int main() {
int a,b;
float c,d,e;
cin>>a>>b;
c=a*2*3.14;
d=a*a*3.14;
e=((a*a)*3.14)*(b/360.0);
cout<<"圓周長為"<<fixed<<setprecision(2)<<c<<endl;
cout<<"圓面積為"<<fixed<<setprecision(2)<<d<<endl;
cout<<"扇形面積為"<<fixed<<setprecision(2)<<e<<endl;
return 0;
}
[34]109上第2次上機考
Page 148, 沈宏霖(10307)@1年3班
5. 奇數還是偶數?
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 2 2021/1/6 上午 06:38:24
Languag
e
Code
C++ /*50c4a199c60c4f15a7098e19ce790c78_5.109上第2次上機考-奇數還是偶數?(
20.0)*/
#include <iostream>
using namespace std;
int main() {
int a;
cin>>a;
if(a%2==0)
cout<<a<<"是偶數"<<endl;
else
cout<<a<<"是奇數"<<endl;
cin>>a;
if(a%2==0)
cout<<a<<"是偶數"<<endl;
else
cout<<a<<"是奇數"<<endl;
return 0;
}
[34]109上第2次上機考
Page 149, 沈宏霖(10307)@1年3班
6. 遊樂場週年慶
Score: 20.0 Lang: c
Student Answer:
Score Times Completed Time
20.0 1 2021/1/6 上午 06:42:20
Languag
e
Code
C++ /*50c4a199c60c4f15a7098e19ce790c78_6.109上第2次上機考-遊樂場週年慶(2
0.0)*/
#include <iostream>
using namespace std;
int main() {
int a;
cin>>a;
if(a%5==0||a%11==0)
cout<<a<<"免費贈送禮物"<<endl;
else
cout<<a<<"銘謝惠顧"<<endl;
cin>>a;
if(a%5==0||a%11==0)
cout<<a<<"免費贈送禮物"<<endl;
else
cout<<a<<"銘謝惠顧"<<endl;
cin>>a;
if(a%5==0||a%11==0)
cout<<a<<"免費贈送禮物"<<endl;
else
cout<<a<<"銘謝惠顧"<<endl;
return 0;
}
[34]109上第2次上機考
Page 151, 沈宏霖(10307)@1年3班
7. 四數比大小
Score: 30.0 Lang: c
Student Answer:
Score Times Completed Time
0.0 2 2021/1/6 上午 07:10:53
Languag
e
Code
C++ /*50c4a199c60c4f15a7098e19ce790c78_7.109上第2次上機考-四數比大小(30.
0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c,d,max,min;
cin>>a>>b>>c>>d;
max=a
if(max>b){
max=b;
if(max<c){
max=c;
if(max<d)
max=d;
}
}
min=d;
if(min>c){
min=c;
if(min>b){
min=b;
if(min>a)
min=a;
}
}
cout<<max<<endl;
cout<<min<<endl;
return 0;
}
[34]109上第2次上機考
Page 153, 沈宏霖(10307)@1年3班
8. 俱樂部會員等級
Score: 30.0 Lang: c
Student Answer:
Score Times Completed Time
30.0 5 2021/1/6 上午 07:09:43
Languag
e
Code
C++ /*50c4a199c60c4f15a7098e19ce790c78_8.109上第2次上機考-俱樂部會員等級
(30.0)*/
#include <iostream>
using namespace std;
int main() {
int a,b,c;
std::cin>>a;
if(a>0){
if(a>=200)std::cout<<a<<"天:白金會員n";
else if(a>=180&&a<=199)std::cout<<a<<"天:金牌會員n";
else if(a>=160&&a<=179)std::cout<<a<<"天:銀牌會員n";
else if(a>=140&&a<=159)std::cout<<a<<"天:銅牌會員n";
else std::cout<<a<<"天:基本會員n";
}
std::cin>>b;
if(b>0){
if(b>=200)std::cout<<b<<"天:白金會員n";
else if(b>=180&&b<=199)std::cout<<b<<"天:金牌會員n";
else if(b>=160&&b<=179)std::cout<<b<<"天:銀牌會員n";
else if(b>=140&&b<=159)std::cout<<b<<"天:銅牌會員n";
else std::cout<<b<<"天:基本會員n";
}
std::cin>>c;
if(c>0){
if(c>=200)std::cout<<c<<"天:白金會員n";
else if(c>=180&&c<=199)std::cout<<c<<"天:金牌會員n";
else if(c>=160&&c<=179)std::cout<<c<<"天:銀牌會員n";
else if(c>=140&&c<=159)std::cout<<c<<"天:銅牌會員n";
else std::cout<<c<<"天:基本會員n";
}
return 0;
}
[34]109上第2次上機考
Page 155, 沈宏霖(10307)@1年3班

1_10307.pdf

  • 1.
    課程總結 學習目標 單元名稱(題數) 配分得分 完成率 時間 輸出函數 測試系統(1) 100 100 100% 2021/1/15 讓螢幕會做秀(6) 100 100 100% 2020/10/7 輸出函數總結 200 200 100% 2020/10/7 變數宣告 資料也有家(8) 105 105 100% 2020/10/27 用電腦玩加法(6) 105 105 100% 2020/10/23 變數宣告總結 210 210 100% 2020/10/23 輸入函數 給什麼印什麼(10) 105 105 100% 2020/10/28 加減乘除取餘數(10) 110 110 100% 2021/1/13 輸入函數總結 215 215 100% 2021/1/13 選擇結構 只選我要的(5) 105 105 100% 2020/12/9 if的妙用(4) 105 105 100% 2020/11/25 else魔法(8) 105 105 100% 2021/1/5 比較中有比較(4) 105 101 96% 2021/1/5 多選一(9) 105 83 79% 2021/1/15 選擇結構總結 525 499 95% 2021/1/15 上機考01 109上第1次上機考(B)(6) 115 115 100% 2020/11/25 上機考01總結 115 115 100% 1900/2/1 109上第1次上機考(B)(複習)(6) 115 115 100% 2020/12/10 *總結 265 115 43% 2020/12/10 上機考01 109上第2次上機考(8) 150 120 80% 2021/1/6 上機考01總結 150 120 80% 2020/12/10 [1年3班], 10307 , 沈宏霖 Page 1, 沈宏霖(10307)@1年3班
  • 2.
    參考資料 [1] 測試系統 Page 2,沈宏霖(10307)@1年3班 測試系統(C)(PDF) https://drive.google.com/file/d/1ehsbhPdSsb-F2OAKJ4_JjC86AhZKtFbj/preview 測試系統(C++)(PDF) https://drive.google.com/file/d/1Q6eR-cp5CzWmcg78UY9Vkg6K7ihOjVUO/preview 總結 [1] 測試系統 Page 2, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 Hello, DICE 100.0 100.0 14 2021/1/15 下午 02:58:13 100 100
  • 3.
    1. Hello, DICE Score:100.0 Lang: c Student Answer: Score Times Completed Time 100.0 14 2021/1/15 下午 02:58:13
  • 4.
    Language Code Python print("Hello,DICE!") C++ #include <iostream> using namespace std; int main() { cout<<"Hello, DICE!"<<endl; return 0; } C Java public class Main { public static void main(String[] args) { System.out.println("Hello, DICE!"); } } [1] 測試系統 Page 4, 沈宏霖(10307)@1年3班
  • 5.
    參考資料 [2]讓螢幕會做秀 Page 5, 沈宏霖(10307)@1年3班 輸出函數(C)(PDF)https://drive.google.com/file/d/1gEsmEqn9H7IB8OmYS5eVj5FuLmaVIGAp/preview 輸出函數(C++)(PDF) https://drive.google.com/file/d/1lwMibOEIrg-EQNbTeQNX7SoNoOb0-hOT/preview 總結 [2]讓螢幕會做秀 Page 5, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 SayHello 10.0 10.0 1 2020/10/7 上午 07:03:22 2 印三角形 10.0 10.0 2 2020/10/7 上午 07:05:35 3 倒印三角形 20.0 20.0 1 2020/10/7 上午 07:07:38 4 不是計算 20.0 20.0 1 2020/10/7 上午 07:09:27 5 來個表格 20.0 20.0 2 2020/10/7 下午 12:13:37 6 身高體重 20.0 20.0 1 2020/10/7 下午 12:16:43 100 100
  • 6.
    1. SayHello Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 1 2020/10/7 上午 07:03:22 Language Code C++ #include <iostream> using namespace std; int main() { cout << "Hello, World!" << endl; return 0; } [2]讓螢幕會做秀 Page 6, 沈宏霖(10307)@1年3班
  • 7.
    2. 印三角形 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 2 2020/10/7 上午 07:05:35 Language Code C++ #include <iostream> using namespace std; int main() { cout << "*" << endl; cout << "**" << endl; cout << "***" << endl; cout << "****" << endl; cout << "*****" << endl; cout << "******" << endl; return 0; } [2]讓螢幕會做秀 Page 7, 沈宏霖(10307)@1年3班
  • 8.
    3. 倒印三角形 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/10/7 上午 07:07:38 Language Code C++ #include <iostream> using namespace std; int main() { cout << "******" << endl; cout << "*****" << endl; cout << "****" << endl; cout << "***" << endl; cout << "**" << endl; cout << "*" << endl; return 0; } [2]讓螢幕會做秀 Page 8, 沈宏霖(10307)@1年3班
  • 9.
    4. 不是計算 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/10/7 上午 07:09:27 Language Code C++ #include <iostream> using namespace std; int main() { cout << "2-3=5" << endl; return 0; } [2]讓螢幕會做秀 Page 9, 沈宏霖(10307)@1年3班
  • 10.
    5. 來個表格 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 2 2020/10/7 下午 12:13:37 Language Code C++ #include <iostream> using namespace std; int main() { cout << "1 1 1" << endl; cout << "2 4 8" << endl; cout << "3 9 27" << endl; cout << "4 16 64" << endl; cout << "5 25 125" << endl; cout << "6 36 216" << endl; cout << "7 49 343" << endl; cout << "8 64 512" << endl; cout << "9 81 729" << endl; cout << "10 100 1000" << endl; return 0; } [2]讓螢幕會做秀 Page 10, 沈宏霖(10307)@1年3班
  • 11.
    6. 身高體重 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/10/7 下午 12:16:43 Language Code C++ #include <iostream> using namespace std; int main() { cout << "Height: 158CM" << endl; cout << "Weight: 55.66KG" << endl; return 0; } [2]讓螢幕會做秀 Page 11, 沈宏霖(10307)@1年3班
  • 12.
    參考資料 [3]資料也有家 Page 12, 沈宏霖(10307)@1年3班 變數與指定運算子(C)(PDF)https://drive.google.com/file/d/1VFwAqvp104-ukQ1H-5_6bYEc0wHCYA65/preview 變數與指定運算子(C++)(PDF) https://drive.google.com/file/d/1gSJSO-5OAH6zU3YEf35rP4v9ePDFT-gM/preview 總結 [3]資料也有家 Page 12, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 印出指定的整數 15.0 15.0 1 2020/10/7 下午 12:21:40 2 加上一些形容詞 15.0 15.0 1 2020/10/7 下午 12:39:17 3 印出2個指定的整數 15.0 15.0 1 2020/10/21 上午 06:54:54 4 印出指定的浮點數 15.0 15.0 1 2020/10/21 上午 07:15:03 5 身高與體重 15.0 15.0 4 2020/10/27 下午 02:19:31 6 最後來的是主人 15.0 15.0 1 2020/10/22 上午 01:17:41 7 最後的結果是? 10.0 10.0 3 2020/10/22 上午 01:32:52 8 自主學習 5.0 5.0 2 2020/10/22 上午 01:35:35 105 105
  • 13.
    1. 印出指定的整數 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 1 2020/10/7 下午 12:21:40 Language Code C++ #include<iostream> using namespace std; int main() { int num; num=3; cout <<num<<endl; return 0; } [3]資料也有家 Page 13, 沈宏霖(10307)@1年3班
  • 14.
    2. 加上一些形容詞 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 1 2020/10/7 下午 12:39:17 Language Code C++ #include<iostream> using namespace std; int main() { int cat; cat=3; cout <<"There are "; cout <<cat; cout <<" cats."<<endl; return 0; } [3]資料也有家 Page 14, 沈宏霖(10307)@1年3班
  • 15.
    3. 印出2個指定的整數 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 1 2020/10/21 上午 06:54:54 Language Code C++ /*3_3.資料也有家-印出2個指定的整數(15.0)*/ #include <iostream> using namespace std; int main() { int a,b; a=3,b=4; cout<< a << endl; cout<< b << endl; return 0; } [3]資料也有家 Page 15, 沈宏霖(10307)@1年3班
  • 16.
    4. 印出指定的浮點數 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 1 2020/10/21 上午 07:15:03 Language Code C++ /*3_4.資料也有家-印出指定的浮點數(15.0)*/ #include <iostream> #include <iomanip> using namespace std; int main() { float num1; num1=10.100000; cout<< fixed << setprecision(4) << "num1=10.100000" <<endl; float num2; num2=5.200000; cout<< fixed << setprecision(4) << "num2=5.200000" <<endl; return 0; } [3]資料也有家 Page 16, 沈宏霖(10307)@1年3班
  • 17.
    5. 身高與體重 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 4 2020/10/27 下午 02:19:31 Language Code C++ /*3_5.資料也有家-身高與體重(15.0)*/ #include <iostream> #include<iomanip> using namespace std; int main(){ int a; a=160; cout<<"My height is "<<a<<" CM."<<endl; float b; b=55.22; cout<<"My weight is "<<b<<" KG."<<endl; return 0; } [3]資料也有家 Page 17, 沈宏霖(10307)@1年3班
  • 18.
    6. 最後來的是主人 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 1 2020/10/22 上午 01:17:41
  • 19.
    Language Code C++ /*3_6.資料也有家-最後來的是主人(15.0)*/ #include<iostream> using namespace std; int main() { int a; a=1; a=2; a=3; a=4; a=5; cout<<a<<endl; return 0; } [3]資料也有家 Page 19, 沈宏霖(10307)@1年3班
  • 20.
    7. 最後的結果是? Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 3 2020/10/22 上午 01:32:52 Language Code C++ /*3_7.資料也有家-最後的結果是?(10.0)*/ #include <iostream> using namespace std; int main() { int a,b; a=5,b=10; a=b; b=a; cout<< a <<"t"<< b <<endl; return 0; } [3]資料也有家 Page 20, 沈宏霖(10307)@1年3班
  • 21.
    8. 自主學習 Score: 5.0Lang: c Student Answer: Score Times Completed Time 5.0 2 2020/10/22 上午 01:35:35 Language Code C++ /*3_8.資料也有家-自主學習(5.0)*/ #include <iostream> using namespace std; int main() { int a; for( a=97 ; a<=97 ; a++ ) { cout << "" << (char)a << endl; } return 0; } [3]資料也有家 Page 21, 沈宏霖(10307)@1年3班
  • 22.
    參考資料 [4]用電腦玩加法 Page 22, 沈宏霖(10307)@1年3班 加法(C)(PDF)https://drive.google.com/file/d/1ESOGCD2QVzq0Lut9rwFBiz8YQV6M3rAa/preview 加法(C++)(PDF) https://drive.google.com/file/d/176myBftbNfYbWePZ5CGy3Swk8g0qKCjJ/preview 總結 [4]用電腦玩加法 Page 22, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 數蘋果 20.0 20.0 1 2020/10/22 上午 01:38:43 2 =不是等號 20.0 20.0 5 2020/10/22 上午 01:47:14 3 加法再現 20.0 20.0 1 2020/10/22 上午 01:49:15 4 四捨五入 20.0 20.0 1 2020/10/22 上午 01:52:20 5 計算一下 20.0 20.0 1 2020/10/23 上午 11:50:50 6 自主學習 5.0 5.0 1 2020/10/23 上午 11:56:03 105 105
  • 23.
    1. 數蘋果 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/10/22 上午 01:38:43 Language Code C++ /*4_1.用電腦玩加法-數蘋果(20.0)*/ #include <iostream> using namespace std; int main() { int a,b,c; a=3,b=4; c=a+b; cout<<a<<"+"<<b<<"="<<c<<endl; return 0; } [4]用電腦玩加法 Page 23, 沈宏霖(10307)@1年3班
  • 24.
    2. =不是等號 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 5 2020/10/22 上午 01:47:14 Language Code C++ /*4_2.用電腦玩加法-=不是等號(20.0)*/ #include <iostream> using namespace std; int main() { int a=3; a=a+10; cout<<"a變為"<<a<<endl; return 0; } [4]用電腦玩加法 Page 24, 沈宏霖(10307)@1年3班
  • 25.
    3. 加法再現 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/10/22 上午 01:49:15 Language Code C++ /*4_3.用電腦玩加法-加法再現(20.0)*/ #include <iostream> using namespace std; int main() { int a,b,c; a=3,b=4; c=a+b; cout<<a<<"+"<<b<<"="<<c<<endl; return 0; } [4]用電腦玩加法 Page 25, 沈宏霖(10307)@1年3班
  • 26.
    4. 四捨五入 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/10/22 上午 01:52:20 Language Code C++ /*4_4.用電腦玩加法-四捨五入(20.0)*/ #include <iostream> #include<iomanip> using namespace std; int main() { float a,b,c; a=4.210000,b=3.100000; c=a+b; cout<<fixed<<setprecision(2)<<c; return 0; } [4]用電腦玩加法 Page 26, 沈宏霖(10307)@1年3班
  • 27.
    5. 計算一下 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/10/23 上午 11:50:50 Languag e Code C++ /*4_5.用電腦玩加法-計算一下(20.0)*/ #include <iostream> using namespace std; int main() { float a1,a2,a3,a4,a5,b; a1=5,a2=9,a3=8,a4=25,a5=13; b=a1+a2+a3+a4+a5; cout<<a1<<"+"<<a2<<"+"<<a3<<"+"<<a4<<"+"<<a5<<"="<<b<< endl; cout<<"a1+a2+a3+a4+a5="<<b<<endl; return 0; } [4]用電腦玩加法 Page 27, 沈宏霖(10307)@1年3班
  • 28.
    6. 自主學習 Score: 5.0Lang: c Student Answer: Score Times Completed Time 5.0 1 2020/10/23 上午 11:56:03 Language Code C++ #include <stdio.h> int main() { int a=97; printf("%c",a=a+2); return 0; } [4]用電腦玩加法 Page 28, 沈宏霖(10307)@1年3班
  • 29.
    參考資料 [5]給什麼印什麼 Page 29, 沈宏霖(10307)@1年3班 變數與輸入函數(C)(PDF)https://drive.google.com/file/d/1Tf1P04ta1VbTjKCGDE7tFqEo9vkEB4O2/preview 變數與輸入函數(C++)(PDF) https://drive.google.com/file/d/1VEWTU325cs3RLMEfx2aPUcbD2hXJkUS2/preview 總結 [5]給什麼印什麼 Page 29, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 輸入1個整數 10.0 10.0 2 2020/10/23 下午 12:42:40 2 輸入2個整數 10.0 10.0 1 2020/10/23 下午 12:46:24 3 兩整數相加 15.0 15.0 2 2020/10/28 上午 07:07:50 4 浮點數 15.0 15.0 2 2020/10/23 下午 01:00:23 5 3個浮點數 10.0 10.0 1 2020/10/26 下午 12:01:39 6 身高與體重 10.0 10.0 2 2020/10/28 上午 06:47:47 7 倒序 10.0 10.0 1 2020/10/26 下午 12:11:17 8 長方形 10.0 10.0 2 2020/10/26 下午 12:15:07 9 印出資料 10.0 10.0 15 2020/10/28 上午 07:02:53 10 自主學習 5.0 5.0 1 2020/10/26 下午 12:25:46 105 105
  • 30.
    1. 輸入1個整數 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 2 2020/10/23 下午 12:42:40
  • 31.
    Language Code C++ #include<iostream> usingnamespace std; int main() { int num; cin>>num; cout<<num; return 0; } C #include <stdio.h> int main() { int a; scanf("%d",&5); //輸入變數a的數值 printf("%d",5); return 0; } [5]給什麼印什麼 Page 31, 沈宏霖(10307)@1年3班
  • 32.
    2. 輸入2個整數 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 1 2020/10/23 下午 12:46:24 Language Code C++ #include<iostream> using namespace std; int main() { int a,b; cin>>a>>b; cout<<b; return 0; } [5]給什麼印什麼 Page 32, 沈宏霖(10307)@1年3班
  • 33.
    3. 兩整數相加 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 2 2020/10/28 上午 07:07:50 Language Code C++ #include <stdio.h> int main() { int a,b; scanf("%dn%d",&a,&b); printf("%d+%d=%d",a,b,a+b); //印出「a」+「b」=「a+b」 return 0; } [5]給什麼印什麼 Page 33, 沈宏霖(10307)@1年3班
  • 34.
    4. 浮點數 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 2 2020/10/23 下午 01:00:23 Language Code C++ #include <iostream> #include <iomanip> using namespace std; int main() { float a; cin>>a; cout<< fixed << setprecision(6) <<a<<endl; return 0; } [5]給什麼印什麼 Page 34, 沈宏霖(10307)@1年3班
  • 35.
    5. 3個浮點數 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 1 2020/10/26 下午 12:01:39 Language Code C++ #include <iostream> #include <iomanip> using namespace std; int main() { float a,b,c; cin>>a; cout<< fixed << setprecision(1) <<a<<endl; cin>>b; cout<< fixed << setprecision(2) <<b<<endl; cin>>c; cout<< fixed << setprecision(3) <<c<<endl; return 0; } [5]給什麼印什麼 Page 35, 沈宏霖(10307)@1年3班
  • 36.
    6. 身高與體重 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 2 2020/10/28 上午 06:47:47 Language Code C++ #include <iostream> #include <iomanip> using namespace std; int main() { int a; float b; cin>>a; cout<<"身高"<<a<<"公分"<<endl; cin>>b; cout<<"體重"<< fixed << setprecision(2) <<b<<"公斤"<<endl; return 0; } [5]給什麼印什麼 Page 36, 沈宏霖(10307)@1年3班
  • 37.
    7. 倒序 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 1 2020/10/26 下午 12:11:17 Language Code C++ #include <iostream> #include <iomanip> using namespace std; int main() { int a,b; cin>>a; cin>>b; cout<<b<< "t" <<a<<endl; return 0; } [5]給什麼印什麼 Page 37, 沈宏霖(10307)@1年3班
  • 38.
    8. 長方形 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 2 2020/10/26 下午 12:15:07 Language Code C++ #include <iostream> #include <iomanip> using namespace std; int main() { int a,b; cin>>a; cin>>b; cout<<a<<"t"<<b<<"t"<<a<<"t"<<b<<endl; return 0; } [5]給什麼印什麼 Page 38, 沈宏霖(10307)@1年3班
  • 39.
    9. 印出資料 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 15 2020/10/28 上午 07:02:53
  • 40.
    Langu age Code C++ #include <iostream> #include<iomanip> using namespace std; int main() { int a; float b; a=175,b=68.5; cout<<"姓名:Jack"<<endl; cout<<"身高:"<<a<<"公分"<<endl; cout<<"體重:"<<fixed<<setprecision(1)<<b<<"公斤"<<endl; cout<<"座右銘:Experience is the best teacher."<<endl; return 0; } C #include <stdio.h> int main() { int a=175; float b=68.5; printf("姓名:Jackn身高:%d公分n體重:%.1f公斤n座右銘:Experience is the best teacher.",a,b); return 0; } [5]給什麼印什麼 Page 40, 沈宏霖(10307)@1年3班
  • 41.
    10. 自主學習 Score: 5.0Lang: c Student Answer: Score Times Completed Time 5.0 1 2020/10/26 下午 12:25:46 Language Code C #include <stdio.h> int main() { int a; scanf("%d",&a); printf("%c",a); return 0; } [5]給什麼印什麼 Page 41, 沈宏霖(10307)@1年3班
  • 42.
    參考資料 [6]加減乘除取餘數 Page 42, 沈宏霖(10307)@1年3班 運算子(C)(PDF)https://drive.google.com/file/d/1Y_BPJ7-rbPJI-f_6ssCp66Qify3NNYkq/preview 運算子(C++)(PDF) https://drive.google.com/file/d/1sbvX6xT4sOWcjAYdA7sdjxhoxEXtWl-r/preview 總結 [6]加減乘除取餘數 Page 42, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 四則運算 15.0 15.0 2 2020/10/26 下午 01:07:58 2 梯形面積 15.0 15.0 5 2020/10/26 下午 01:07:14 3 溫度換算 10.0 10.0 18 2020/11/11 上午 07:04:23 4 時間計算 10.0 10.0 4 2021/1/13 下午 12:41:35 5 緞帶長度 10.0 10.0 3 2020/10/26 下午 02:03:48 6 年利率 10.0 10.0 2 2020/10/27 下午 12:20:50 7 圓周長與面積 10.0 10.0 1 2020/10/27 下午 12:27:45 8 衛星繞地球 15.0 15.0 1 2020/10/27 下午 12:45:11 9 製作時間 10.0 10.0 3 2020/10/27 下午 01:42:39 10 自主學習 5.0 5.0 1 2020/10/26 下午 01:48:32 110 110
  • 43.
  • 44.
    Student Answer: Score TimesCompleted Time 15.0 2 2020/10/26 下午 01:07:58 Langua ge Code C++ #include<iostream> using namespace std; int main() { int num1,num2;/*宣告二個整數變數*/ cin>>num1>>num2;/*輸入兩個整數變數*/ cout<<num1<<"+"<<num2<<"="<<num1+num2<<endl;/*加*/ cout<<num1<<"-"<<num2<<"="<<num1-num2<<endl;/*減*/ cout<<num1<<"*"<<num2<<"="<<num1*num2<<endl;/*乘*/ cout<<num1<<"/"<<num2<<"="<<num1/num2<<"餘"<<num1%num2< <endl;/*除與取餘數*/ return 0; } C #include <stdio.h> int main() { int a; int b; scanf ("%d %d",&a,&b); printf("%d+%d=%dn",a,b,a+b); printf("%d-%d=%dn",a,b,a-b); printf("%d*%d=%dn",a,b,a*b); printf("%d/%d=%d餘%dn",a,b,a/b,a%b); return 0; } [6]加減乘除取餘數 Page 44, 沈宏霖(10307)@1年3班
  • 45.
    2. 梯形面積 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 5 2020/10/26 下午 01:07:14
  • 46.
    Langua ge Code C++ #include<iostream> #include<iomanip> using namespacestd; int main() { float num1,num2,num3;/*宣告二個整數變數*/ cin>>num1>>num2>>num3;/*輸入兩個整數變數*/ cout<<"梯形面積="<<fixed<<setprecision(1)<< ((num1+num2)*num3)/2<<"平方公分"<<endl; return 0; } C #include <stdio.h> int main() { int a,b,c; float d; scanf("%d %d %d",&a,&b,&c); d=(a+b)*c/2; printf("梯形面積=%.1f平方公分",d); return 0; } [6]加減乘除取餘數 Page 46, 沈宏霖(10307)@1年3班
  • 47.
    3. 溫度換算 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 18 2020/11/11 上午 07:04:23
  • 48.
    Language Code C++ #include<iostream> #include<iomanip> usingnamespace std; int main() { int a,b,c; float num1,num2,num3;/*宣告二個整數變數*/ cin>>a>>b>>c;/*輸入兩個整數變數*/ num1=(9.0/5.0)*a+32; cout<<"1.華氏溫度為"<<fixed<<setprecision(1)<<num1<<endl; num2=(9.0/5.0)*b+32; cout<<"2.華氏溫度為"<<fixed<<setprecision(1)<<num2<<endl; num3=(9.0/5.0)*c+32; cout<<"3.華氏溫度為"<<fixed<<setprecision(1)<<num3<<endl; return 0; } C #include <stdio.h> int main() { float a,b,c; scanf("%f %f %f",&a,&b,&c); printf("1.華氏溫度為%.1fn",(9.0/5.0)*a+32); printf("2.華氏溫度為%.1fn",(9.0/5.0)*b+32); printf("3.華氏溫度為%.1f",(9.0/5.0)*c+32); return 0; } [6]加減乘除取餘數 Page 48, 沈宏霖(10307)@1年3班
  • 49.
    4. 時間計算 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 4 2021/1/13 下午 12:41:35 Language Code C++ #include<iostream> #include<iomanip> using namespace std; int main() { float min,s,a;/*宣告二個整數變數*/ min=1,s=15; cin>>a;/*輸入兩個整數變數*/ cout<<a<<"個粽子共需要"<<a*min<<"分"<<a*s<<"秒"<<endl; return 0; } C #include <stdio.h> int main() { int a,m,s; scanf("%d",&a); m=75*a/60; s=75*a-60*m; printf("%d個粽子共需要%d分%d秒",a,m,s); return 0; } [6]加減乘除取餘數 Page 49, 沈宏霖(10307)@1年3班
  • 50.
    5. 緞帶長度 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 3 2020/10/26 下午 02:03:48 Language Code C #include <stdio.h> int main() { int a; scanf("%d",&a); printf("緞帶原來長%d公尺",a*2*2*2); return 0; } C++ #include<iostream> #include<iomanip> using namespace std; int main() { float a,b;/*宣告二個整數變數*/ cin>>a;/*輸入兩個整數變數*/ b=a*2*2*2; cout<<"緞帶原來長"<<b<<"公尺"<<endl; return 0; } [6]加減乘除取餘數 Page 50, 沈宏霖(10307)@1年3班
  • 51.
    6. 年利率 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 2 2020/10/27 下午 12:20:50 Language Code C++ #include<iostream> #include<iomanip> using namespace std; int main() { int d; float a,m,c;/*宣告二個整數變數*/ cin>>m>>a>>d;/*輸入兩個整數變數*/ c=(m*a)*d/365; cout<<fixed<<setprecision(2)<<c<<endl; cin>>m>>a>>d;/*輸入兩個整數變數*/ c=(m*a)*d/365; cout<<fixed<<setprecision(2)<<c<<endl; return 0; } [6]加減乘除取餘數 Page 51, 沈宏霖(10307)@1年3班
  • 52.
    7. 圓周長與面積 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 1 2020/10/27 下午 12:27:45 Language Code C++ #include<iostream> #include<iomanip> using namespace std; int main() { int a,q; float p,b,c,d; p=3.14; cin>>a>>q; b=2*a*p; c=a*a*p; d=(a*a*p)*q/360; cout<<"圓周長為"<<fixed<<setprecision(2)<<b<<endl; cout<<"圓面積為"<<fixed<<setprecision(2)<<c<<endl; cout<<"扇形面積為"<<fixed<<setprecision(2)<<d<<endl; return 0; } [6]加減乘除取餘數 Page 52, 沈宏霖(10307)@1年3班
  • 53.
    8. 衛星繞地球 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 1 2020/10/27 下午 12:45:11 Language Code C++ #include<iostream> #include<iomanip> using namespace std; int main() { int x,y,z; cin>>x>>y;/*輸入兩個整數變數*/ z=((x*60)+25/102)/100; cout<<z<<"圈"<<endl; return 0; } [6]加減乘除取餘數 Page 53, 沈宏霖(10307)@1年3班
  • 54.
    9. 製作時間 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 3 2020/10/27 下午 01:42:39
  • 55.
    Language Code C++ /*6_9.加減乘除取餘數-製作時間(10.0)*/ #include<iostream> using namespace std; int main() { int a,b,c; float d; cin>>a>>b; c=((a*72)+(b*150))/60; d=((a*72)+(b*150))-(c*60); cout<<c<<"分"<<d<<"秒"<<endl; cin>>a>>b; c=((a*72)+(b*150))/60; d=((a*72)+(b*150))-(c*60); cout<<c<<"分"<<d<<"秒"<<endl; return 0; } C #include <stdio.h> int main() { int b,f; scanf("%d %d",&b,&f); printf("%d分%d秒n",(72*b+150*f)/60,72*b+150*f-(72*b+150*f)/60*60); scanf("%d %d",&b,&f); printf("%d分%d秒",(72*b+150*f)/60,72*b+150*f-(72*b+150*f)/60*60); return 0; } [6]加減乘除取餘數 Page 55, 沈宏霖(10307)@1年3班
  • 56.
    10. 自主學習 Score: 5.0Lang: c Student Answer: Score Times Completed Time 5.0 1 2020/10/26 下午 01:48:32 Language Code C++ #include <stdio.h> int main() { char a; scanf("%c",&a); if((a>='A')&&(a<='Z')) { a+=32; printf("%c",a); } else if((a>='a')&&(a<='z')) { a-=32; printf("%c",a); } else { printf("%c",a); } return 0; } [6]加減乘除取餘數 Page 56, 沈宏霖(10307)@1年3班
  • 57.
    參考資料 [7]只選我要的 Page 57, 沈宏霖(10307)@1年3班 單一選擇(C)(PDF)https://drive.google.com/file/d/1rNFp5Ya681VOq4VVBLLa1KY2caPlmGYb/preview 單一選擇(C++)(PDF) https://drive.google.com/file/d/1IFkSJjWI0M5SG4D3EEXzcUpozcT72cmM/preview 總結 [7]只選我要的 Page 57, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 選正數 25.0 25.0 1 2020/11/11 上午 06:47:47 2 選偶數 25.0 25.0 2 2020/11/25 上午 06:49:29 3 發現不相等 25.0 25.0 2 2020/11/25 下午 01:17:24 4 輸出絕對值 25.0 25.0 9 2020/12/9 上午 06:52:28 5 自主學習 5.0 5.0 1 2020/11/25 下午 01:24:59 105 105
  • 58.
    1. 選正數 Score: 25.0Lang: c Student Answer: Score Times Completed Time
  • 59.
    25.0 1 2020/11/11上午 06:47:47 Language Code C++ #include <iostream> using namespace std; int main() { int n;/*宣告整數變數*/ cin>>n;/*輸入整數變數*/ if(n>0){ cout<<n<<"是正數"<<endl; } return 0; } [7]只選我要的 Page 59, 沈宏霖(10307)@1年3班
  • 60.
  • 61.
    Student Answer: Score TimesCompleted Time 25.0 2 2020/11/25 上午 06:49:29 Language Code C++ #include <iostream> using namespace std; int main() { int n,m;/*宣告整數變數*/ cin>>n; m=n/2;/*輸入整數變數*/ if(m=1){ cout<<n<<"是偶數"<<endl; } return 0; } [7]只選我要的 Page 61, 沈宏霖(10307)@1年3班
  • 62.
    3. 發現不相等 Score: 25.0Lang: c Student Answer: Score Times Completed Time 25.0 2 2020/11/25 下午 01:17:24
  • 63.
    Language Code C++ #include<iostream> using namespace std; int main() { int n,m,a;/*宣告整數變數*/ cin>>n>>m; if(n!=m){ cout<<n<<"!="<<m<<endl; } return 0; } [7]只選我要的 Page 63, 沈宏霖(10307)@1年3班
  • 64.
    4. 輸出絕對值 Score: 25.0Lang: c Student Answer: Score Times Completed Time 25.0 9 2020/12/9 上午 06:52:28
  • 65.
    Language Code C++ #include<iostream> #include<iomanip> using namespace std; int main() { float a;/*宣告整數變數*/ cin>>a; if(a<0){ cout<<fixed<<setprecision(2)<<a*-1<<endl; } return 0; } C #include <stdio.h> #include <stdlib.h> int main () { float a; scanf("%f",&a); printf("%.2fn",abs(a)); //印出a的絕對值 return 0; } [7]只選我要的 Page 65, 沈宏霖(10307)@1年3班
  • 66.
    5. 自主學習 Score: 5.0Lang: c Student Answer: Score Times Completed Time 5.0 1 2020/11/25 下午 01:24:59
  • 67.
    Language Code C++ #include<stdio.h> int main() { int a,b,e,f; scanf("%d %d",&a,&b); if (a==1) e=2300; if (a==2) e=800; if (a==3) e=500; if (a==4) e=1500; if (b==1) f=2300; if (b==2) f=800; if (b==3) f=500; if (b==4) f=1500; if (e+f<3000) printf("符合預算n"); if (e+f>3000) printf("超出預算n"); scanf("%d %d",&a,&b); if (a==1) e=2300; if (a==2) e=800; if (a==3) e=500; if (a==4) e=1500; if (b==1) f=2300; if (b==2) f=800; if (b==3) f=500; if (b==4) f=1500; if (e+f<3000) printf("符合預算n"); if (e+f>3000) printf("超出預算n"); return 0; } [7]只選我要的 Page 67, 沈宏霖(10307)@1年3班
  • 68.
    參考資料 [8]if的妙用 Page 68, 沈宏霖(10307)@1年3班 用if交換變數(C)(PDF)https://drive.google.com/file/d/1oYhfeBtVnxy3vwPpxRmuVaJ1LrkPqR26/preview 用if交換變數(C++)(PDF) https://drive.google.com/file/d/1yqTUfGUXdVDFjREuBsw4qyaaYA1oMBfV/preview 總結 [8]if的妙用 Page 68, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 比大小 30.0 30.0 1 2020/11/25 上午 06:54:07 2 三數比大小 30.0 30.0 7 2020/11/25 下午 01:39:44 3 五數比大小 40.0 40.0 1 2020/11/25 下午 01:42:57 4 自主學習 5.0 5.0 1 2020/11/25 下午 01:43:44 105 105
  • 69.
  • 70.
    Student Answer: Score TimesCompleted Time 30.0 1 2020/11/25 上午 06:54:07 Language Code C++ #include <iostream> using namespace std; int main() { int a,b,max; cin>>a>>b; max=a; if(b>max){ max=b; } cout<<"最大值"<<max<<endl; /*第二輪判斷*/ cin>>a>>b; max=a; if(b>max){ max=b; } cout<<"最大值"<<max<<endl; return 0; } [8]if的妙用 Page 70, 沈宏霖(10307)@1年3班
  • 71.
    2. 三數比大小 Score: 30.0Lang: c Student Answer: Score Times Completed Time 30.0 7 2020/11/25 下午 01:39:44
  • 72.
    Language Code C++ #include<iostream> using namespace std; int main() { int a,b,c,max,min; cin>>a>>b>>c; max=a; if(b>max){ max=b; } if(c>max){ max=c; } cout<<"最大值"<<max<<endl; min=a; if(min>b){ min=b; } if(min>c){ min=c; } cout<<"最小值"<<min<<endl; /*第二輪判斷*/ cin>>a>>b>>c; max=a; if(b>max){ max=b; } if(c>max){ max=c; } cout<<"最大值"<<max<<endl; min=a; if(min>b){ min=b; } if(min>c){ min=c; } cout<<"最小值"<<min<<endl; return 0; } [8]if的妙用 Page 72, 沈宏霖(10307)@1年3班
  • 73.
    3. 五數比大小 Score: 40.0Lang: c Student Answer: Score Times Completed Time 40.0 1 2020/11/25 下午 01:42:57
  • 74.
    Language Code C++ #include<iostream> using namespace std; int main() { int a,b,c,d,e,max,min; cin>>a>>b>>c>>d>>e; max=a; if(b>max){ max=b; } if(c>max){ max=c; } if(d>max){ max=d; } if(e>max){ max=e; } cout<<"最大值"<<max<<endl; min=a; if(min>b){ min=b; } if(min>c){ min=c; } if(min>d){ min=d; } if(min>e){ min=e; } cout<<"最小值"<<min<<endl; return 0; } [8]if的妙用 Page 74, 沈宏霖(10307)@1年3班
  • 75.
    4. 自主學習 Score: 5.0Lang: c Student Answer: Score Times Completed Time 5.0 1 2020/11/25 下午 01:43:44
  • 76.
    Language Code C++ #include<stdio.h> #include <stdlib.h> int main() { int leap; int year; scanf("%d", &year); if (0 == year % 4) { if (0 != year % 100) { leap = 1; } else { if (0 == year % 400) { leap = 1; } else { leap = 0; } } } else { leap = 0; } if (0 == leap) { printf("平年n"); } else { printf("閏年n"); } scanf("%d", &year); if (0 == year % 4) { if (0 != year % 100) { leap = 1; } else { if (0 == year % 400) { leap = 1; } [8]if的妙用 Page 76, 沈宏霖(10307)@1年3班
  • 77.
    else { leap = 0; } } } else { leap= 0; } if (0 == leap) { printf("平年n"); } else { printf("閏年n"); } scanf("%d", &year); if (0 == year % 4) { if (0 != year % 100) { leap = 1; } else { if (0 == year % 400) { leap = 1; } else { leap = 0; } } } else { leap = 0; } if (0 == leap) { printf("平年n"); } else { printf("閏年n"); } scanf("%d", &year); if (0 == year % 4) { if (0 != year % 100) [8]if的妙用 Page 77, 沈宏霖(10307)@1年3班
  • 78.
    { leap = 1; } else { if(0 == year % 400) { leap = 1; } else { leap = 0; } } } else { leap = 0; } if (0 == leap) { printf("平年n"); } else { printf("閏年n"); } return 0; } [8]if的妙用 Page 78, 沈宏霖(10307)@1年3班
  • 79.
    參考資料 [9]else魔法 Page 79, 沈宏霖(10307)@1年3班 二分選擇(C)(PDF)https://drive.google.com/file/d/1tbGJYWmghxQ89vEoocZ7lhNYzKcSFN1i/preview 二分選擇(C++)(PDF) https://drive.google.com/file/d/16Kd-LoL7rNB1rJtdSer08PpCf4_D70md/preview 總結 [9]else魔法 Page 79, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 奇數還是偶數? 15.0 15.0 1 2020/12/16 上午 06:47:05 2 是否能構成三角形? 15.0 15.0 9 2020/12/16 上午 07:19:07 3 是否直角三角形? 15.0 15.0 3 2020/12/18 下午 12:02:38 4 是否與7相關? 15.0 15.0 1 2020/12/18 下午 12:08:42 5 是否為3的倍數-1? 10.0 10.0 1 2020/12/18 下午 12:11:17 6 是否為3的倍數-2? 10.0 10.0 4 2021/1/5 下午 12:48:29 7 是否為迴文? 20.0 20.0 1 2020/12/18 下午 12:23:46 8 自主學習 5.0 5.0 1 2020/12/18 下午 12:27:37 105 105
  • 80.
  • 81.
    Student Answer: Score TimesCompleted Time 15.0 1 2020/12/16 上午 06:47:05 Language Code C++ /*9_1.else魔法-奇數還是偶數?(15.0)*/ #include <iostream> using namespace std; int main() { int num;/*宣告整數變數*/ cin>>num;/*輸入整數變數*/ if(num%2==0){/*判斷n的餘數是否為0*/ cout<<num<<"是偶數"<<endl; } else{/*二分法*/ cout<<num<<"是奇數"<<endl; } /*第二輪判斷*/ cin>>num;/*輸入整數變數*/ if(num%2==0){/*判斷n的餘數是否為0*/ cout<<num<<"是偶數"<<endl; } else{/*二分法*/ cout<<num<<"是奇數"<<endl; } return 0; } [9]else魔法 Page 81, 沈宏霖(10307)@1年3班
  • 82.
    2. 是否能構成三角形? Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 9 2020/12/16 上午 07:19:07
  • 83.
    Language Code C++ /*9_2.else魔法-是否能構成三角形?(15.0)*/ #include<iostream> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if(a+b>c && a+c>b && b+c>a) { cout<<a<<" "<<b<<" "<<c<<"可以構成三角形"<<endl; } else { cout<<a<<" "<<b<<" "<<c<<"不可以構成三角形"<<endl; } cin>>a>>b>>c; if(a+b>c && a+c>b && b+c>a) { cout<<a<<" "<<b<<" "<<c<<"可以構成三角形"<<endl; } else { cout<<a<<" "<<b<<" "<<c<<"不可以構成三角形"<<endl; } return 0; } [9]else魔法 Page 83, 沈宏霖(10307)@1年3班
  • 84.
    3. 是否直角三角形? Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 3 2020/12/18 下午 12:02:38
  • 85.
    Language Code C++ /*9_3.else魔法-是否直角三角形?(15.0)*/ #include<iostream> using namespace std; int main() { int a, b, c; cin>>a>>b>>c; //判斷是否滿足三角形條件:兩邊之和是否大於第三邊; if (a + b > c&&b + c > a&&a + c > a){ //判斷是否有兩邊的平方和大於第三邊的平方; if ((a*a + b*b == c*c) || (a*a + c*c == b*b) || (b*b + c*c == a*a)) { cout<<"直角三角形"<<endl; } else{ cout<<"不是直角三角形"<<endl; } } cin>>a>>b>>c; //判斷是否滿足三角形條件:兩邊之和是否大於第三邊; if (a + b > c&&b + c > a&&a + c > a){ //判斷是否有兩邊的平方和大於第三邊的平方; if ((a*a + b*b == c*c) || (a*a + c*c == b*b) || (b*b + c*c == a*a)) { cout<<"直角三角形"<<endl; } else{ cout<<"不是直角三角形"<<endl; } } return 0; } [9]else魔法 Page 85, 沈宏霖(10307)@1年3班
  • 86.
    4. 是否與7相關? Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 1 2020/12/18 下午 12:08:42
  • 87.
    Language Code C++ /*9_4.else魔法-是否與7相關?(15.0)*/ #include<iostream> using namespace std; int main() { int n,x,y; cin>>n; x=n%7; y=n/1%10; if(x==0||y==7) { cout<<n<<"符合標準"<<endl; } else { cout<<n<<"不符合標準"<<endl; } cin>>n; x=n%7; y=n/1%10; if(x==0||y==7) { cout<<n<<"符合標準"<<endl; } else { cout<<n<<"不符合標準"<<endl; } cin>>n; x=n%7; y=n/1%10; if(x==0||y==7) { cout<<n<<"符合標準"<<endl; } else { cout<<n<<"不符合標準"<<endl; } return 0; } [9]else魔法 Page 87, 沈宏霖(10307)@1年3班
  • 88.
    5. 是否為3的倍數-1? Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 1 2020/12/18 下午 12:11:17 Language Code C++ /*9_5.else魔法-是否為3的倍數-1?(10.0)*/ #include <iostream> using namespace std; int main() { int a; cin>>a; cout<<a/100%10<<endl; cout<<a/10%10<<endl; cout<<a/1%10<<endl; return 0; } [9]else魔法 Page 88, 沈宏霖(10307)@1年3班
  • 89.
    6. 是否為3的倍數-2? Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 4 2021/1/5 下午 12:48:29
  • 90.
    Language Code C++ #include<stdio.h> int main() { int a,b,c,d; scanf("%d",&a); b=a/100%10%3; c=a/10%10%3; d=a/1%10%3; if(b==0) printf("百位數%d是3的倍數n",a/100%10); if(b!=0) printf("百位數%d不是3的倍數n",a/100%10); if(c==0) printf("十位數%d是3的倍數n",a/10%10); if(c!=0) printf("十位數%d不是3的倍數n",a/10%10); if(d==0) printf("個位數%d是3的倍數n",a/1%10); if(d!=0) printf("個位數%d不是3的倍數n",a/1%10); return 0; } [9]else魔法 Page 90, 沈宏霖(10307)@1年3班
  • 91.
    7. 是否為迴文? Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/12/18 下午 12:23:46
  • 92.
    Language Code C++ /*9_7.else魔法-是否為迴文?(20.0)*/ #include<iostream> using namespace std; int main() { int x,a,b,c,d,e; cin>>x; a=x/10000%10%3; b=x/1000%10%3; c=x/100%10%3; d=x/10%10%3; e=x/1%10%3; if(a==e&&b==d) cout<<x<<"是迴文"<<endl; else cout<<x<<"不是迴文"<<endl; cin>>x; a=x/10000%10%3; b=x/1000%10%3; c=x/100%10%3; d=x/10%10%3; e=x/1%10%3; if(a==e&&b==d) cout<<x<<"是迴文"<<endl; else cout<<x<<"不是迴文"<<endl; return 0; } [9]else魔法 Page 92, 沈宏霖(10307)@1年3班
  • 93.
    8. 自主學習 Score: 5.0Lang: c Student Answer: Score Times Completed Time 5.0 1 2020/12/18 下午 12:27:37
  • 94.
    Language Code C++ /*9_8.else魔法-自主學習(5.0)*/ #include<iostream> using namespace std; int main() { int x,a=80,b=64,c=72; cin>>x; if(x==5) cout<<a<<"分"<<endl; if(x==7) cout<<b<<"分"<<endl; if(x==18) cout<<c<<"分"<<endl; else cout<<"成績不存在"<<endl; cin>>x; if(x==5) cout<<a<<"分"<<endl; if(x==7) cout<<b<<"分"<<endl; if(x==18) cout<<c<<"分"<<endl; else cout<<"成績不存在"<<endl; return 0; } [9]else魔法 Page 94, 沈宏霖(10307)@1年3班
  • 95.
    參考資料 [10]比較中有比較 Page 95, 沈宏霖(10307)@1年3班 巢狀比較(C)(PDF)https://drive.google.com/file/d/1zTO_1xpLYUmRh2SOs1sk-QY2sqymmu6b/preview 巢狀比較(C++)(PDF) https://drive.google.com/file/d/1YMq4WnIm8_9yXpgSQT3YEbsFKqBQfJwd/preview 總結 [10]比較中有比較 Page 95, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 分數等第 40.0 40.0 2 2020/12/30 上午 06:51:47 2 正三角形嗎? 30.0 30.0 7 2020/12/23 上午 07:17:00 3 玩玩二分法 30.0 30.0 1 2021/1/5 下午 12:44:25 4 自主學習 5.0 1.0 2 2021/1/5 下午 12:45:00 105 101
  • 96.
    1. 分數等第 Score: 40.0Lang: c Student Answer:
  • 97.
    Score Times CompletedTime 40.0 2 2020/12/30 上午 06:51:47 Language Code C++ #include <iostream> int main() { int x; std::cin>>x; if (x>=90)std::cout<<"Your score is "<<x<<" and degree is A!n"; else if (x>=80)std::cout<<"Your score is "<<x<<" and degree is B!n"; else if (x>=70)std::cout<<"Your score is "<<x<<" and degree is C!n"; else if (x>=60)std::cout<<"Your score is "<<x<<" and degree is D!n"; else std::cout<<"Your score is "<<x<<" and degree is F!n"; std::cin>>x; if (x>=90)std::cout<<"Your score is "<<x<<" and degree is A!n"; else if (x>=80)std::cout<<"Your score is "<<x<<" and degree is B!n"; else if (x>=70)std::cout<<"Your score is "<<x<<" and degree is C!n"; else if (x>=60)std::cout<<"Your score is "<<x<<" and degree is D!n"; else std::cout<<"Your score is "<<x<<" and degree is F!n"; std::cin>>x; if (x>=90)std::cout<<"Your score is "<<x<<" and degree is A!n"; else if (x>=80)std::cout<<"Your score is "<<x<<" and degree is B!n"; else if (x>=70)std::cout<<"Your score is "<<x<<" and degree is C!n"; else if (x>=60)std::cout<<"Your score is "<<x<<" and degree is D!n"; else std::cout<<"Your score is "<<x<<" and degree is F!n"; return 0; } [10]比較中有比較 Page 97, 沈宏霖(10307)@1年3班
  • 98.
    2. 正三角形嗎? Score: 30.0Lang: c Student Answer: Score Times Completed Time 30.0 7 2020/12/23 上午 07:17:00
  • 99.
    Language Code C++ /*10_2.比較中有比較-正三角形嗎?(30.0)*/ #include<iostream> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if((a+b>c)&&(b+c>a)&&(c+a>b)) { if(a==b && b==c && c==a) { cout<<a<<" "<<b<<" "<<c<<"正三角形"<<endl; } else { cout<<a<<" "<<b<<" "<<c<<"非正三角形"<<endl; } } else { cout<<a<<" "<<b<<" "<<c<<"無法構成三角形"<<endl; } cin>>a>>b>>c; if((a+b>c)&&(b+c>a)&&(c+a>b)) { if(a==b && b==c && c==a) { cout<<a<<" "<<b<<" "<<c<<"正三角形"<<endl; } else { cout<<a<<" "<<b<<" "<<c<<"非正三角形"<<endl; } } else { cout<<a<<" "<<b<<" "<<c<<"無法構成三角形"<<endl; } cin>>a>>b>>c; if((a+b>c)&&(b+c>a)&&(c+a>b)) { if(a==b && b==c && c==a) { cout<<a<<" "<<b<<" "<<c<<"正三角形"<<endl; } else { cout<<a<<" "<<b<<" "<<c<<"非正三角形"<<endl; } } else [10]比較中有比較 Page 99, 沈宏霖(10307)@1年3班
  • 100.
    { cout<<a<<" "<<b<<" "<<c<<"無法構成三角形"<<endl; } return0; } [10]比較中有比較 Page 100, 沈宏霖(10307)@1年3班
  • 101.
    3. 玩玩二分法 Score: 30.0Lang: c Student Answer: Score Times Completed Time 30.0 1 2021/1/5 下午 12:44:25
  • 102.
    Language Code C++ #include<stdio.h> int main() { int a; scanf("%d",&a); if (a>0) { printf("%d是正數n",a); if (a<=10000) printf("An"); else printf("Bn"); } if (a<0) { printf("%d是負數n",a); if (a<=-10000) printf("Cn"); else printf("Dn"); } scanf("%d",&a); if (a>0) { printf("%d是正數n",a); if (a<=10000) printf("An"); else printf("Bn"); } if (a<0) { printf("%d是負數n",a); if (a<=-10000) printf("Cn"); else printf("Dn"); } scanf("%d",&a); if (a>0) { printf("%d是正數n",a); if (a<=10000) printf("An"); else printf("Bn"); } if (a<0) [10]比較中有比較 Page 102, 沈宏霖(10307)@1年3班
  • 103.
  • 104.
    4. 自主學習 Score: 5.0Lang: c Student Answer: Score Times Completed Time 1.0 2 2021/1/5 下午 12:45:00
  • 105.
    Language Code C++ #include<stdio.h> int main(){ char a; scanf("%c",&a); if (a>=65&&a<=90) { printf("大寫n"); } else if (a>=97&&a<=122) { printf("小寫n"); } else { printf("都不是n"); } scanf("%c",&a); if (a>=65&&a<=90) { printf("大寫n"); } else if (a>=97&&a<=122) { printf("小寫n"); } else { printf("都不是n"); } scanf("%c",&a); if (a>=65&&a<=90) { printf("大寫n"); } else if (a>=97&&a<=122) { printf("小寫n"); } else { printf("都不是n"); } scanf("%c",&a); if (a>=65&&a<=90) { printf("大寫n"); } [10]比較中有比較 Page 105, 沈宏霖(10307)@1年3班
  • 106.
    else if (a>=97&&a<=122) { printf("小寫n"); } else { printf("都不是n"); } scanf("%c",&a); if(a>=65&&a<=90) { printf("大寫n"); } else if (a>=97&&a<=122) { printf("小寫n"); } else { printf("都不是n"); } return 0; } [10]比較中有比較 Page 106, 沈宏霖(10307)@1年3班
  • 107.
    參考資料 [11]多選一 Page 107, 沈宏霖(10307)@1年3班 多選一(C)(PDF)https://drive.google.com/file/d/1i-ASUt_r2YEtdAuyRorCTDsx7oLYHAnK/preview 多選一(C++)(PDF) https://drive.google.com/file/d/1TPp2kokF7IH6Ysc3TfhEOSd5iAxVcGlS/preview 總結 [11]多選一 Page 107, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 分數等第 15.0 15.0 2 2020/12/30 上午 07:04:34 2 年齡說 15.0 15.0 9 2021/1/13 下午 01:14:51 3 薪資計算 15.0 15.0 2 2021/1/5 下午 01:13:51 4 月份判斷 15.0 0.0 15 2021/1/15 下午 02:04:23 5 三角形型別 15.0 10.512820482254028 1 2021/1/5 下午 01:40:20 6 BMI-1 15.0 15.0 3 2021/1/5 下午 01:55:41 7 BMI-2 5.0 5.0 2 2021/1/5 下午 02:07:54 8 BMI-3 5.0 3.333333333333333 1 2021/1/5 下午 02:09:10 9 自主學習 5.0 5.0 1 2021/1/5 下午 01:40:59 105 83
  • 108.
  • 109.
    Student Answer: Score TimesCompleted Time 15.0 2 2020/12/30 上午 07:04:34 Language Code C++ /*11_1.多選一-分數等第(15.0)*/ #include <iostream> using namespace std; int main() { int a; std::cin>>a; if(a>=0&&a<=100){ if(a>=90)std::cout<<"Your score is "<<a<<" and degree is A!n"; else if (a>=80)std::cout<<"Your score is "<<a<<" and degree is B!n"; else if (a>=70)std::cout<<"Your score is "<<a<<" and degree is C!n"; else if (a>=60)std::cout<<"Your score is "<<a<<" and degree is D!n"; else std::cout<<"Your score is "<<a<<" and degree is F!n"; } std::cin>>a; if(a>=0&&a<=100){ if(a>=90)std::cout<<"Your score is "<<a<<" and degree is A!n"; else if (a>=80)std::cout<<"Your score is "<<a<<" and degree is B!n"; else if (a>=70)std::cout<<"Your score is "<<a<<" and degree is C!n"; else if (a>=60)std::cout<<"Your score is "<<a<<" and degree is D!n"; else std::cout<<"Your score is "<<a<<" and degree is F!n"; } std::cin>>a; if(a>=0&&a<=100){ if(a>=90)std::cout<<"Your score is "<<a<<" and degree is A!n"; else if (a>=80)std::cout<<"Your score is "<<a<<" and degree is B!n"; else if (a>=70)std::cout<<"Your score is "<<a<<" and degree is C!n"; else if (a>=60)std::cout<<"Your score is "<<a<<" and degree is D!n"; else std::cout<<"Your score is "<<a<<" and degree is F!n"; } return 0; } [11]多選一 Page 109, 沈宏霖(10307)@1年3班
  • 110.
    2. 年齡說 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 9 2021/1/13 下午 01:14:51
  • 111.
    Language Code C++ /*11_2.多選一-年齡說(15.0)*/ #include<iostream> using namespace std; int main() { int a; std::cin>>a; if (a<100&&a>0){ if (a>=70)std::cout<<a<<"歲是從心所欲,不逾矩之年n"; else if (a>=60)std::cout<<a<<"歲是耳順之年n"; else if (a>=50)std::cout<<a<<"歲是知天命之年n"; else if (a>=40)std::cout<<a<<"歲是不惑之年n"; else if (a>=30)std::cout<<a<<"歲是而立之年n"; else if (a>=15)std::cout<<a<<"歲是志於學n"; else std::cout<<a<<"歲是小孩子n"; } std::cin>>a; if (a<100&&a>0){ if (a>=70)std::cout<<a<<"歲是從心所欲,不逾矩之年n"; else if (a>=60)std::cout<<a<<"歲是耳順之年n"; else if (a>=50)std::cout<<a<<"歲是知天命之年n"; else if (a>=40)std::cout<<a<<"歲是不惑之年n"; else if (a>=30)std::cout<<a<<"歲是而立之年n"; else if (a>=15)std::cout<<a<<"歲是志於學n"; else std::cout<<a<<"歲是小孩子n"; } std::cin>>a; if (a<100&&a>0){ if (a>=70)std::cout<<a<<"歲是從心所欲,不逾矩之年n"; else if (a>=60)std::cout<<a<<"歲是耳順之年n"; else if (a>=50)std::cout<<a<<"歲是知天命之年n"; else if (a>=40)std::cout<<a<<"歲是不惑之年n"; else if (a>=30)std::cout<<a<<"歲是而立之年n"; else if (a>=15)std::cout<<a<<"歲是志於學n"; else std::cout<<a<<"歲是小孩子n"; } return 0; } [11]多選一 Page 111, 沈宏霖(10307)@1年3班
  • 112.
    3. 薪資計算 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 2 2021/1/5 下午 01:13:51
  • 113.
    Language Code C++ #include<stdio.h> int main() { int x; float y; scanf("%d",&x); if (x<=60) { printf ("%dn",x*75); } else if (x>60&&x<=75) { printf ("%gn",60*75+(x-60)*75*1.25); } else { printf ("%gn",60*75+15*75*1.25+(x-75)*75*1.75); } return 0; } [11]多選一 Page 113, 沈宏霖(10307)@1年3班
  • 114.
    4. 月份判斷 Score: 15.0Lang: c Student Answer: Score Times Completed Time 0.0 15 2021/1/15 下午 02:04:23
  • 115.
    Language Code C++ /*11_4.多選一-月份判斷(15.0)*/ #include<iostream> using namespace std; int main() { int a; std::cin>>a; if(a=1&&a<13){ if (a=1)std::cout<<a<<"月是冬天n"; else if (a=2)std::cout<<a<<"月是冬天n"; else if (a=3)std::cout<<a<<"月是春天n"; else if (a=4)std::cout<<a<<"月是春天n"; else if (a=5)std::cout<<a<<"月是春天n"; else if (a=6)std::cout<<a<<"月是夏天n"; else if (a=7)std::cout<<a<<"月是夏天n"; else if (a=8)std::cout<<a<<"月是夏天n"; else if (a=9)std::cout<<a<<"月是秋天n"; else if (a=10)std::cout<<a<<"月是秋天n"; else if (a=11)std::cout<<a<<"月是秋天n"; else if (a=12)std::cout<<a<<"月是冬天n"; else std::cout<<"超出範圍n"; } return 0; } [11]多選一 Page 115, 沈宏霖(10307)@1年3班
  • 116.
    5. 三角形型別 Score: 15.0Lang: c Student Answer: Score Times Completed Time 10.512820482254028 1 2021/1/5 下午 01:40:20
  • 117.
    Language Code C++ #include<stdio.h> #include<stdlib.h> #include<math.h> intmain() { int a, b, c; int s, area; scanf("%d %d %d", &a, &b, &c); //判斷是否滿足三角形條件:兩邊之和是否大於第三邊; if (a + b > c&&b + c > a&&a + c > a) { //判斷三條邊是否相等; if (a == b&&a == c) { printf("%d %d %d正三角形n",a, b, c); } //判斷三角形是否有兩天邊相等; else if (a == b || a == c || b == c) { printf("%d %d %d等腰三角形n",a, b, c); } //判斷是否有兩邊的平方和大於第三邊的平方; else { printf("%d %d %d直角三角形n",a, b, c); } } else { printf("%d %d %d無法構成三角形n",a, b, c); } scanf("%d %d %d", &a, &b, &c); scanf("%d %d %d", &a, &b, &c); //判斷是否滿足三角形條件:兩邊之和是否大於第三邊; if (a + b > c&&b + c > a&&a + c > a) { //判斷三條邊是否相等; if (a == b&&a == c) { printf("%d %d %d正三角形n",a, b, c); } //判斷三角形是否有兩天邊相等; else if (a == b || a == c || b == c) { printf("%d %d %d等腰三角形n",a, b, c); } //判斷是否有兩邊的平方和大於第三邊的平方; else { printf("%d %d %d直角三角形n",a, b, c); [11]多選一 Page 117, 沈宏霖(10307)@1年3班
  • 118.
    } } else { printf("%d %d %d無法構成三角形n",a,b, c); } scanf("%d %d %d", &a, &b, &c); scanf("%d %d %d", &a, &b, &c); //判斷是否滿足三角形條件:兩邊之和是否大於第三邊; if (a + b > c&&b + c > a&&a + c > a) { //判斷三條邊是否相等; if (a == b&&a == c) { printf("%d %d %d正三角形n",a, b, c); } //判斷三角形是否有兩天邊相等; else if (a == b || a == c || b == c) { printf("%d %d %d等腰三角形n",a, b, c); } //判斷是否有兩邊的平方和大於第三邊的平方; else { printf("%d %d %d直角三角形n",a, b, c); } } else { printf("%d %d %d無法構成三角形n",a, b, c); } scanf("%d %d %d", &a, &b, &c); return 0; } [11]多選一 Page 118, 沈宏霖(10307)@1年3班
  • 119.
    6. BMI-1 Score: 15.0Lang: c Student Answer: Score Times Completed Time
  • 120.
    15.0 3 2021/1/5下午 01:55:41 Language Code C++ #include <stdio.h> int main() { int kg; float m,bmi; scanf("%dn%f",&kg,&m); bmi=kg/(m*m); if (bmi>18.5&&bmi<=24) { printf("BMI=%.6fn你的體重在正常範圍n",bmi); } else { printf("BMI=%.6fn你的體重不標準n",bmi); } return 0; } [11]多選一 Page 120, 沈宏霖(10307)@1年3班
  • 121.
  • 122.
    Student Answer: Score TimesCompleted Time 5.0 2 2021/1/5 下午 02:07:54 Language Code C++ #include <stdio.h> int main() { int kg; float m,bmi; scanf("%dn%f",&kg,&m); bmi=kg/(m*m); if (bmi<18.5) { printf("BMI=%.2fn你的體重太輕n",bmi); } else if (bmi>=18.5&&bmi<24) { printf("BMI=%.2fn你的體重在正常範圍n",bmi); } else if (bmi>=24&&bmi<27) { printf("BMI=%.2fn你的體重過重n",bmi); } else if (bmi>=27&&bmi<30) { printf("BMI=%.2fn輕度肥胖n",bmi); } else if (bmi>=30&&bmi<35) { printf("BMI=%.2fn中度肥胖n",bmi); } else { printf("BMI=%.2fn重度肥胖n",bmi); } return 0; } [11]多選一 Page 122, 沈宏霖(10307)@1年3班
  • 123.
  • 124.
    Student Answer: Score TimesCompleted Time 3.333333333333333 1 2021/1/5 下午 02:09:10 Language Code C++ #include <stdio.h> int main() { int kg,g; float m,bmi; scanf("%dn%dn%f",&g,&kg,&m); bmi=kg/(m*m); if (g==1) { printf("男生nBMI=%.1fn",bmi); if (bmi>=20&&bmi<25) { printf("標準範圍n"); } else if (bmi<20) { printf("體重太輕n"); } else if (bmi>=25) { printf("體重太重n"); } } if (g==0) { printf("女生nBMI=%.1fn",bmi); if (bmi>=18&&bmi<22) { printf("標準範圍n"); } else if (bmi<18) { printf("體重太輕n"); } else if (bmi>=22) { printf("體重太重n"); } } return 0; } [11]多選一 Page 124, 沈宏霖(10307)@1年3班
  • 125.
    9. 自主學習 Score: 5.0Lang: c Student Answer: Score Times Completed Time 5.0 1 2021/1/5 下午 01:40:59
  • 126.
    Language Code C++ #include<stdio.h> #include <stdlib.h> int main() { int leap; int year; scanf("%d", &year); if (0 == year % 4) { if (0 != year % 100) { leap = 1; } else { if (0 == year % 400) { leap = 1; } else { leap = 0; } } } else { leap = 0; } if (0 == leap) { printf("平年n"); } else { printf("閏年n"); } scanf("%d", &year); if (0 == year % 4) { if (0 != year % 100) { leap = 1; } else { if (0 == year % 400) { leap = 1; [11]多選一 Page 126, 沈宏霖(10307)@1年3班
  • 127.
    } else { leap = 0; } } } else { leap= 0; } if (0 == leap) { printf("平年n"); } else { printf("閏年n"); } scanf("%d", &year); if (0 == year % 4) { if (0 != year % 100) { leap = 1; } else { if (0 == year % 400) { leap = 1; } else { leap = 0; } } } else { leap = 0; } if (0 == leap) { printf("平年n"); } else { printf("閏年n"); } scanf("%d", &year); [11]多選一 Page 127, 沈宏霖(10307)@1年3班
  • 128.
    if (0 ==year % 4) { if (0 != year % 100) { leap = 1; } else { if (0 == year % 400) { leap = 1; } else { leap = 0; } } } else { leap = 0; } if (0 == leap) { printf("平年n"); } else { printf("閏年n"); } scanf("%d", &year); if (0 == year % 4) { if (0 != year % 100) { leap = 1; } else { if (0 == year % 400) { leap = 1; } else { leap = 0; } } } else { leap = 0; [11]多選一 Page 128, 沈宏霖(10307)@1年3班
  • 129.
    } if (0 ==leap) { printf("平年n"); } else { printf("閏年n"); } return 0; } [11]多選一 Page 129, 沈宏霖(10307)@1年3班
  • 130.
    參考資料 [32]109上第1次上機考(B) Page 130, 沈宏霖(10307)@1年3班 2.輸出函數(PDF ) http://210.60.224.1/~goodnice418/dice/2-%E8%BC%B8%E5%87%BA%E5%87%BD%E6%95%B8.pdf 3.變數與指定運 算子(PDF) http://210.60.224.1/~goodnice418/dice/3-%E8%AE%8A%E6%95%B8%E8%88%87%E6%8C%87%E5%AE%9A%E9 4.加法(PDF) http://210.60.224.1/~goodnice418/dice/4-%E5%8A%A0%E6%B3%95.pdf 5. 變數與輸入 函數(PDF) http://210.60.224.1/~goodnice418/dice/5-%E8%AE%8A%E6%95%B8%E8%88%87%E8%BC%B8%E5%85%A5%E5 6.運算子(PDF) http://210.60.224.1/~goodnice418/dice/6-%E9%81%8B%E7%AE%97%E5%AD%90.pdf 總結 [32]109上第1次上機考(B) Page 130, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 我要Pass 20.0 20.0 1 2020/11/25 上午 06:25:03 2 今夕是何年? 20.0 20.0 1 2020/11/25 上午 06:26:48 3 三角形面積 20.0 20.0 1 2020/11/25 上午 06:28:47 4 溫度換算 20.0 20.0 1 2020/11/25 上午 06:38:26 5 圓周長與面積 20.0 20.0 3 2020/11/25 上午 06:44:31 6 搶購iPhone12 15.0 15.0 1 2020/11/25 上午 06:47:51 115 115
  • 131.
    1. 我要Pass Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/11/25 上午 06:25:03 Language Code C++ /*31_p_1.109上第1次上機考(B)-我要Pass(20.0)*/ #include <iostream> using namespace std; int main() { cout<<"我要Pass!"<<endl; cout<<"我要Pass!"<<endl; cout<<"我要Pass!"<<endl; return 0; } [32]109上第1次上機考(B) Page 131, 沈宏霖(10307)@1年3班
  • 132.
    2. 今夕是何年? Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/11/25 上午 06:26:48 Language Code C++ /*31_p_2.109上第1次上機考(B)-今夕是何年?(20.0)*/ #include <iostream> using namespace std; int main() { int a,b; cin>>a; b=a+1911; cout<<b<<endl; return 0; } [32]109上第1次上機考(B) Page 132, 沈宏霖(10307)@1年3班
  • 133.
    3. 三角形面積 Score: 20.0Lang: {} Student Answer: Score Times Completed Time 20.0 1 2020/11/25 上午 06:28:47 Language Code C++ /*31_p_3.109上第1次上機考(B)-三角形面積(20.0)*/ #include <iostream> using namespace std; int main() { int a,b,c; cin>>a>>b; c=(a*b)/2; cout<<"三角形面積="<<c<<"平方公分"<<endl; return 0; } [32]109上第1次上機考(B) Page 133, 沈宏霖(10307)@1年3班
  • 134.
    4. 溫度換算 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/11/25 上午 06:38:26 Language Code C++ /*31_p_4.109上第1次上機考(B)-溫度換算(20.0)*/ #include <iostream> #include<iomanip> using namespace std; int main() { int a,b,c; float a1,b1,c1; cin>>a>>b>>c; a1=(a-32)*5.0/9.0; cout<<"1.攝氏溫度為"<<fixed<<setprecision(1)<<a1<<endl; b1=(b-32)*5.0/9.0; cout<<"2.攝氏溫度為"<<fixed<<setprecision(1)<<b1<<endl; c1=(c-32)*5.0/9.0; cout<<"3.攝氏溫度為"<<fixed<<setprecision(1)<<c1<<endl; return 0; } [32]109上第1次上機考(B) Page 134, 沈宏霖(10307)@1年3班
  • 135.
    5. 圓周長與面積 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 3 2020/11/25 上午 06:44:31 Language Code C++ /*31_p_5.109上第1次上機考(B)-圓周長與面積(20.0)*/ #include <iostream> #include<iomanip> using namespace std; int main() { int a,b; float c,d,e; cin>>a>>b; c=(a*2)*3.14; cout<<"圓周長為"<<fixed<<setprecision(2)<<c<<endl; d=(a*a)*3.14; cout<<"圓面積為"<<fixed<<setprecision(2)<<d<<endl; e=((a*a)*3.14)*45.0/360.0; cout<<"扇形面積為"<<fixed<<setprecision(2)<<e<<endl; return 0; } [32]109上第1次上機考(B) Page 135, 沈宏霖(10307)@1年3班
  • 136.
    6. 搶購iPhone12 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 1 2020/11/25 上午 06:47:51 Language Code C++ /*31_p_6.109上第1次上機考(B)-搶購iPhone12(15.0)*/ #include <iostream> using namespace std; int main() { int a,b,c,d; cin>>a>>b; c=(a*60)+b; d=c/80; cout<<d<<"支"<<endl; return 0; } [32]109上第1次上機考(B) Page 136, 沈宏霖(10307)@1年3班
  • 137.
    參考資料 [33]109上第1次上機考(B)(複習) Page 137, 沈宏霖(10307)@1年3班 -- 總結 [33]109上第1次上機考(B)(複習) Page 137, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 我要Pass 20.0 20.0 1 2020/12/9 上午 06:53:24 2 今夕是何年? 20.0 20.0 1 2020/12/9 上午 06:54:50 3 三角形面積 20.0 20.0 1 2020/12/9 上午 07:05:23 4 溫度換算 20.0 20.0 6 2020/12/10 下午 12:40:30 5 圓周長與面積 20.0 20.0 1 2020/12/10 下午 12:40:18 6 搶購iPhone12 15.0 15.0 1 2020/12/10 下午 12:43:11 115 115
  • 138.
    1. 我要Pass Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/12/9 上午 06:53:24 Languag e Code C++ /*bd681fa1fdc340f1927dc8ba052667e6_1.109上第1次上機考(B)(複習)-我要Pa ss(20.0)*/ #include <iostream> using namespace std; int main() { cout<<"我要Pass!"<<endl; cout<<"我要Pass!"<<endl; cout<<"我要Pass!"<<endl; return 0; } [33]109上第1次上機考(B)(複習) Page 138, 沈宏霖(10307)@1年3班
  • 139.
    2. 今夕是何年? Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/12/9 上午 06:54:50 Langua ge Code C++ /*bd681fa1fdc340f1927dc8ba052667e6_2.109上第1次上機考(B)(複習)-今夕是 何年?(20.0)*/ #include <iostream> using namespace std; int main() { int a,b; cin>>a; b=a+1911; cout<<b<<endl; return 0; } [33]109上第1次上機考(B)(複習) Page 139, 沈宏霖(10307)@1年3班
  • 140.
    3. 三角形面積 Score: 20.0Lang: {} Student Answer: Score Times Completed Time 20.0 1 2020/12/9 上午 07:05:23 Langua ge Code C++ /*bd681fa1fdc340f1927dc8ba052667e6_3.109上第1次上機考(B)(複習)-三角形 面積(20.0)*/ #include <iostream> using namespace std; int main() { int a,b,c; cin>>a>>b; c=(a*b)/2; cout<<"三角形面積="<<c<<"平方公分"<<endl; return 0; } [33]109上第1次上機考(B)(複習) Page 140, 沈宏霖(10307)@1年3班
  • 141.
    4. 溫度換算 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 6 2020/12/10 下午 12:40:30 Language Code C++ #include<iostream> #include<iomanip> using namespace std; int main() { int a,b,c; float num1,num2,num3;/*宣告二個整數變數*/ cin>>a>>b>>c;/*輸入兩個整數變數*/ num1=(5.0/9.0)*(a-32); cout<<"1.攝氏溫度為"<<fixed<<setprecision(1)<<num1<<endl; num2=(5.0/9.0)*(b-32); cout<<"2.攝氏溫度為"<<fixed<<setprecision(1)<<num2<<endl; num3=(5.0/9.0)*(c-32); cout<<"3.攝氏溫度為"<<fixed<<setprecision(1)<<num3<<endl; return 0; } [33]109上第1次上機考(B)(複習) Page 141, 沈宏霖(10307)@1年3班
  • 142.
    5. 圓周長與面積 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2020/12/10 下午 12:40:18 Langua ge Code C++ /*bd681fa1fdc340f1927dc8ba052667e6_5.109上第1次上機考(B)(複習)-圓周長 與面積(20.0)*/ #include <iostream> #include<iomanip> using namespace std; int main() { int a,b; float c,d,e; cin>>a>>b; c=2*a*3.14; d=(a*a)*3.14; e=((a*a)*3.14)*(b/360.00); cout<<"圓周長為"<<fixed<<setprecision(2)<<c<<endl; cout<<"圓面積為"<<fixed<<setprecision(2)<<d<<endl; cout<<"扇形面積為"<<fixed<<setprecision(2)<<e<<endl; return 0; } [33]109上第1次上機考(B)(複習) Page 142, 沈宏霖(10307)@1年3班
  • 143.
    6. 搶購iPhone12 Score: 15.0Lang: c Student Answer: Score Times Completed Time 15.0 1 2020/12/10 下午 12:43:11 Langua ge Code C++ /*bd681fa1fdc340f1927dc8ba052667e6_6.109上第1次上機考(B)(複習)-搶購iPh one12(15.0)*/ #include <iostream> using namespace std; int main() { int a,b,c,d,n1; cin>>a>>b; c=a*60; d=c+b; n1=d/80; cout<<n1<<"支"<<endl; return 0; } [33]109上第1次上機考(B)(複習) Page 143, 沈宏霖(10307)@1年3班
  • 144.
    參考資料 [34]109上第2次上機考 Page 144, 沈宏霖(10307)@1年3班 2-輸出函數(PDF)http://210.60.224.1/~goodnice418/dice/2-%E8%BC%B8%E5%87%BA%E5%87%BD%E6%95%B8.pdf 3-變數與指定運 算子(PDF) http://210.60.224.1/~goodnice418/dice/3-‹Šex‚c[š•K{—[P.pdf 4. 加法(PDF) http://210.60.224.1/~goodnice418/dice/4-%E5%8A%A0%E6%B3%95.pdf 5. 變數與輸入函 數(PDF) http://210.60.224.1/~goodnice418/dice/5-%E8%AE%8A%E6%95%B8%E8%88%87%E8%BC%B8%E5%85%A5% 6.運算子(PDF) http://210.60.224.1/~goodnice418/dice/6-%E9%81%8B%E7%AE%97%E5%AD%90.pdf 7-單一選擇(PDF) http://210.60.224.1/~goodnice418/dice/7-U®N•xdÇ.pdf 8-用if交換變數(P DF) http://210.60.224.1/~goodnice418/dice/8-u(ifN¤cÛ‹Šex.pdf 9-二分法(PDF) http://210.60.224.1/~goodnice418/dice/9-NŒRlÕ.pdf 10-巢狀比較(PDF ) http://210.60.224.1/~goodnice418/dice/10-]ârÀkÔ•.pdf 總結 [34]109上第2次上機考 Page 144, 沈宏霖(10307)@1年3班 # 名稱 配分 得分 次數 時間 1 三角形面積 10.0 10.0 1 2021/1/6 上午 06:24:51 2 溫度換算 10.0 10.0 1 2021/1/6 上午 06:29:29 3 時間換算 10.0 10.0 1 2021/1/6 上午 06:30:55 4 圓周長與面積 20.0 20.0 1 2021/1/6 上午 06:34:47 5 奇數還是偶數? 20.0 20.0 2 2021/1/6 上午 06:38:24 6 遊樂場週年慶 20.0 20.0 1 2021/1/6 上午 06:42:20 7 四數比大小 30.0 0.0 2 2021/1/6 上午 07:10:53 8 俱樂部會員等級 30.0 30.0 5 2021/1/6 上午 07:09:43 150 120
  • 145.
    1. 三角形面積 Score: 10.0Lang: {} Student Answer: Score Times Completed Time 10.0 1 2021/1/6 上午 06:24:51 Languag e Code C++ /*50c4a199c60c4f15a7098e19ce790c78_1.109上第2次上機考-三角形面積(10. 0)*/ #include <iostream> using namespace std; int main() { int a,b,c; cin>>a>>b; c=(a*b)/2; cout<<"三角形面積="<<c<<"平方公分"<<endl; return 0; } [34]109上第2次上機考 Page 145, 沈宏霖(10307)@1年3班
  • 146.
    2. 溫度換算 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 1 2021/1/6 上午 06:29:29 Languag e Code C++ /*50c4a199c60c4f15a7098e19ce790c78_2.109上第2次上機考-溫度換算(10.0) */ #include <iostream> #include<iomanip> using namespace std; int main() { int a,b,c; float d,e,f; cin>>a>>b>>c; d=(5.0/9.0)*(a-32); e=(5.0/9.0)*(b-32); f=(5.0/9.0)*(c-32); cout<<"1.攝氏溫度為"<<fixed<<setprecision(1)<<d<<endl; cout<<"2.攝氏溫度為"<<fixed<<setprecision(1)<<e<<endl; cout<<"3.攝氏溫度為"<<fixed<<setprecision(1)<<f<<endl; return 0; } [34]109上第2次上機考 Page 146, 沈宏霖(10307)@1年3班
  • 147.
    3. 時間換算 Score: 10.0Lang: c Student Answer: Score Times Completed Time 10.0 1 2021/1/6 上午 06:30:55 Languag e Code C++ /*50c4a199c60c4f15a7098e19ce790c78_3.109上第2次上機考-時間換算(10.0) */ #include <iostream> using namespace std; int main() { int a,b,c; cin>>a>>b; c=(a*60)+b; cout<<c<<"分鐘"<<endl; return 0; } [34]109上第2次上機考 Page 147, 沈宏霖(10307)@1年3班
  • 148.
    4. 圓周長與面積 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2021/1/6 上午 06:34:47 Languag e Code C++ /*50c4a199c60c4f15a7098e19ce790c78_4.109上第2次上機考-圓周長與面積(2 0.0)*/ #include <iostream> #include<iomanip> using namespace std; int main() { int a,b; float c,d,e; cin>>a>>b; c=a*2*3.14; d=a*a*3.14; e=((a*a)*3.14)*(b/360.0); cout<<"圓周長為"<<fixed<<setprecision(2)<<c<<endl; cout<<"圓面積為"<<fixed<<setprecision(2)<<d<<endl; cout<<"扇形面積為"<<fixed<<setprecision(2)<<e<<endl; return 0; } [34]109上第2次上機考 Page 148, 沈宏霖(10307)@1年3班
  • 149.
    5. 奇數還是偶數? Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 2 2021/1/6 上午 06:38:24 Languag e Code C++ /*50c4a199c60c4f15a7098e19ce790c78_5.109上第2次上機考-奇數還是偶數?( 20.0)*/ #include <iostream> using namespace std; int main() { int a; cin>>a; if(a%2==0) cout<<a<<"是偶數"<<endl; else cout<<a<<"是奇數"<<endl; cin>>a; if(a%2==0) cout<<a<<"是偶數"<<endl; else cout<<a<<"是奇數"<<endl; return 0; } [34]109上第2次上機考 Page 149, 沈宏霖(10307)@1年3班
  • 150.
    6. 遊樂場週年慶 Score: 20.0Lang: c Student Answer: Score Times Completed Time 20.0 1 2021/1/6 上午 06:42:20
  • 151.
    Languag e Code C++ /*50c4a199c60c4f15a7098e19ce790c78_6.109上第2次上機考-遊樂場週年慶(2 0.0)*/ #include <iostream> usingnamespace std; int main() { int a; cin>>a; if(a%5==0||a%11==0) cout<<a<<"免費贈送禮物"<<endl; else cout<<a<<"銘謝惠顧"<<endl; cin>>a; if(a%5==0||a%11==0) cout<<a<<"免費贈送禮物"<<endl; else cout<<a<<"銘謝惠顧"<<endl; cin>>a; if(a%5==0||a%11==0) cout<<a<<"免費贈送禮物"<<endl; else cout<<a<<"銘謝惠顧"<<endl; return 0; } [34]109上第2次上機考 Page 151, 沈宏霖(10307)@1年3班
  • 152.
    7. 四數比大小 Score: 30.0Lang: c Student Answer: Score Times Completed Time 0.0 2 2021/1/6 上午 07:10:53
  • 153.
    Languag e Code C++ /*50c4a199c60c4f15a7098e19ce790c78_7.109上第2次上機考-四數比大小(30. 0)*/ #include <iostream> usingnamespace std; int main() { int a,b,c,d,max,min; cin>>a>>b>>c>>d; max=a if(max>b){ max=b; if(max<c){ max=c; if(max<d) max=d; } } min=d; if(min>c){ min=c; if(min>b){ min=b; if(min>a) min=a; } } cout<<max<<endl; cout<<min<<endl; return 0; } [34]109上第2次上機考 Page 153, 沈宏霖(10307)@1年3班
  • 154.
    8. 俱樂部會員等級 Score: 30.0Lang: c Student Answer: Score Times Completed Time 30.0 5 2021/1/6 上午 07:09:43
  • 155.
    Languag e Code C++ /*50c4a199c60c4f15a7098e19ce790c78_8.109上第2次上機考-俱樂部會員等級 (30.0)*/ #include <iostream> usingnamespace std; int main() { int a,b,c; std::cin>>a; if(a>0){ if(a>=200)std::cout<<a<<"天:白金會員n"; else if(a>=180&&a<=199)std::cout<<a<<"天:金牌會員n"; else if(a>=160&&a<=179)std::cout<<a<<"天:銀牌會員n"; else if(a>=140&&a<=159)std::cout<<a<<"天:銅牌會員n"; else std::cout<<a<<"天:基本會員n"; } std::cin>>b; if(b>0){ if(b>=200)std::cout<<b<<"天:白金會員n"; else if(b>=180&&b<=199)std::cout<<b<<"天:金牌會員n"; else if(b>=160&&b<=179)std::cout<<b<<"天:銀牌會員n"; else if(b>=140&&b<=159)std::cout<<b<<"天:銅牌會員n"; else std::cout<<b<<"天:基本會員n"; } std::cin>>c; if(c>0){ if(c>=200)std::cout<<c<<"天:白金會員n"; else if(c>=180&&c<=199)std::cout<<c<<"天:金牌會員n"; else if(c>=160&&c<=179)std::cout<<c<<"天:銀牌會員n"; else if(c>=140&&c<=159)std::cout<<c<<"天:銅牌會員n"; else std::cout<<c<<"天:基本會員n"; } return 0; } [34]109上第2次上機考 Page 155, 沈宏霖(10307)@1年3班