Skip to content

oscarlustarrail/-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 

Repository files navigation

高一上

我的自主學習成果

基本資料

學生姓名:呂尚庭

學習主題:C++程式和邏輯推理

學習週數:7週

使用工具:C++、GitHub

目標

建立基本的程式邏輯思考能力

使用 C++ 寫程式

理解 if / while / for 等控制結構

理學習成果整至 GitHub

學習內容整理

週次 學習內容 學到的重點
第1週 C++ 輸出輸入 cout、cin
第2週 if-else 判斷 邏輯判斷
第3週 for / while 重複執行
第4週 1+2+...+100 運算
第5週 質數判斷 邏輯
第6週 函式 程式優化
第7週 猜數字遊戲 綜合應用

學習成果展示

#include <iostream>
using namespace std;
int main(){ 
int a =234;
int b;
cout << "猜數字,1~1000" << endl;

while(true){
    cin >> b;

    if(b > 1000 || b < 1){
        cout << "輸入1~1000" << endl;
        continue;
    }

    if(b > a){
        cout << "太大" << endl;
    }
    else if(b < a){
        cout << "太小" << endl;
    }
    else{
        cout << "恭喜" << endl;
        break;   
    }
}

return 0;
}

成果介紹

1.使用者輸入數字

2.判斷太大 / 太小

3.猜對即結束

我學到...

程式重要的是想清楚流程

if 很重要

錯誤中學習

GitHub 可以展示成果

遇到的難題與解決方法

難題 解決方法
不懂while怎麼停 學會使用break
常打錯=與== 練習多次判斷

學習心得

這次的自主學習讓我第一次完整體驗寫程式的過程。 一開始覺得C++很困難,但後來我漸漸喜歡上寫程式。 未來我希望能設計出許多遊戲。

About

高一上

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors