發表文章

HW02 Python運算子表達式

圖片
1.  Notebooklm 2. 3. 學習卡 及測驗 4. 寫1個程式需附加說明 Create a README For Github 1. 專案名稱 car-speed-calculator 2. C 語言程式碼 檔案名稱: main.c c #include <stdio.h> int main() { float distance, time, speed; // Input distance in meters printf("Enter distance in meters: "); scanf("%f", &distance); // Input time in seconds printf("Enter time in seconds: "); scanf("%f", &time); // Calculate speed if (time > 0) { speed = distance / time; printf("Speed of the car = %.2f m/s\n", speed); } else { printf("Time must be greater than zero.\n"); } return 0; } 程式說明 #include <stdio.h> :引入標準輸入與輸出函式庫。 float distance, time, speed; :宣告距離、時間和速度變數。 scanf() :讓使用者透過鍵盤輸入距離和時間。 speed = distance / time; :使用距離除以時間計算速度。 if (time > 0) :確保時間大於零,避免除以零。 printf() :顯示計算結果。 %.2f :將速度顯示至小數點後兩位。 計算公式: Speed = Distance Time Speed = Time Distance ​ 3. GitHub README.md...

HW01

圖片
 1. notebooklm 學習卡 測驗 4.寫一個程式附加readme說明 小恐龍 專案結構 dino-game/ ├── index.html ├── style.css ├── game.js └── README.md index.html <! DOCTYPE html > < html lang = "zh-Hant" > < head > < meta charset = "UTF-8" /> < meta name = "viewport" content = "width=device-width, initial-scale=1.0" /> < title >小恐龍遊戲</ title > < link rel = "stylesheet" href = "style.css" /> </ head > < body > < main class = "game" > < h1 >🦖 小恐龍遊戲</ h1 > < div class = "score" > 分數:< span id = "score" >0</ span > < span class = "high-score" > 最高分:< span id = "highScore" >0</ span > </ span > </ div > < div id = "gameArea" class = "game-area" > < div id = "dino...