註冊
登錄
論壇
搜索
幫助
導航
私人消息 (0)
公共消息 (0)
系統消息 (0)
好友消息 (0)
帖子消息 (0)
種子論壇 | 高雄市資訊培育協會學員討論區
»
結訓課程 (青少年程式設計班)
»
程式解題我最行 (週六10:00-12:00)
» 2023/09/02 課堂重點
返回列表
發帖
發短消息
加為好友
陳育霖
當前離線
UID
69100
帖子
1566
精華
3
積分
90
閱讀權限
100
來自
0xf0000
在線時間
662 小時
註冊時間
2023-5-13
最後登錄
2024-9-20
版主
1
#
跳轉到
»
倒序看帖
打印
字體大小:
t
T
陳育霖
發表於 2023-8-31 23:19
|
只看該作者
2023/09/02 課堂重點
今日上課重點:
複習
206 選擇敘述與迴圈 (奇數和)
複習
301 函式與陣列 (小星星)
310 函式與陣列 (阿姆斯壯數)
今日作業:
106 基本認識 (計算兩點座標的距離)
208 選擇敘述與迴圈 (找質數)
考試:
202 選擇敘述與迴圈 (分數調整)
306 函式與陣列 (階乘)
錄影連結:
https://drive.google.com/drive/f ... 5NnEpBz?usp=sharing
收藏
分享
發短消息
加為好友
林羿丞
當前離線
UID
68287
帖子
597
精華
0
積分
0
閱讀權限
10
在線時間
117 小時
註冊時間
2019-7-8
最後登錄
2023-12-23
新手上路
2
#
林羿丞
發表於 2023-9-2 10:34
|
只看該作者
本帖最後由 林羿丞 於 2023-9-2 10:45 編輯
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
if(n>100 ||n<0)
cout<<"error"<<endl;
else
cout << (n>60? n+10:n+5) << endl;
}
#include<bits/stdc++.h>
using namespace std;
int compute(int n){
if(n==0)
return 1;
else
return n*compute(n-1);
}
int main(){
int n;
cin>>n;
cout<<n<<"!="<<compute(n)<<endl;
}
複製代碼
TOP
發短消息
加為好友
王銘鴻
當前離線
UID
68266
帖子
595
精華
0
積分
0
閱讀權限
10
來自
太陽系
在線時間
160 小時
註冊時間
2019-6-27
最後登錄
2023-11-11
新手上路
3
#
王銘鴻
發表於 2023-9-7 21:21
|
只看該作者
#include<bits/stdc++.h>
using namespace std;
int a1,a2,a3,a4;
int main()
{
cin >> a1 >> a2 >> a3 >> a4;
printf("%.2f\n",sqrt(pow(a1-a3,2)+pow(a2-a4,2)));
return 0;
}
複製代碼
TOP
發短消息
加為好友
王銘鴻
當前離線
UID
68266
帖子
595
精華
0
積分
0
閱讀權限
10
來自
太陽系
在線時間
160 小時
註冊時間
2019-6-27
最後登錄
2023-11-11
新手上路
4
#
王銘鴻
發表於 2023-9-7 21:34
|
只看該作者
#include<bits/stdc++.h>
using namespace std;
int a1;
int main ()
{
cin >> a1 ;
for(int j=2;j<a1;j++)
{
bool prime=true;
for(int i=2;i<=sqrt(j);i++)
{
if(j%i==0)
{
prime=false;
}
}
if(prime)
cout<< j <<" ";
}
return 0;
}
複製代碼
TOP
發短消息
加為好友
林羿丞
當前離線
UID
68287
帖子
597
精華
0
積分
0
閱讀權限
10
在線時間
117 小時
註冊時間
2019-7-8
最後登錄
2023-12-23
新手上路
5
#
林羿丞
發表於 2023-9-9 10:34
|
只看該作者
本帖最後由 林羿丞 於 2023-9-9 10:35 編輯
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
printf("%.2f\n",sqrt(pow(c-a,2)+pow(d-b,2)));
}
複製代碼
TOP
發短消息
加為好友
林羿丞
當前離線
UID
68287
帖子
597
精華
0
積分
0
閱讀權限
10
在線時間
117 小時
註冊時間
2019-7-8
最後登錄
2023-12-23
新手上路
6
#
林羿丞
發表於 2023-9-9 10:35
|
只看該作者
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(int t=2; t<n; t++)
{
bool b=true;
for(int i=2; i<t; i++)
{
if(t%i==0)
{
b=false;
break;
}
}
if(b==true)
cout<<t<<" ";
}
return 0;
}
複製代碼
TOP
發短消息
加為好友
曾宥程
當前離線
UID
68225
帖子
579
精華
0
積分
0
閱讀權限
10
在線時間
126 小時
註冊時間
2019-4-12
最後登錄
2023-12-16
新手上路
7
#
曾宥程
發表於 2023-9-9 10:36
|
只看該作者
本帖最後由 曾宥程 於 2023-9-9 10:48 編輯
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d;
int main()
{
cin >> a >> b >> c >> d;
printf("%.2f",sqrt(pow((c-a),2)+pow((d-b),2)));
return 0;
}
複製代碼
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
for(int i=2 ; i<n ; i++)
{
bool isPrime = true;
for(int j=2 ; j<=sqrt(i) ; j++)
{
if(!(i%j))
isPrime = false;
}
if(isPrime)
cout << i <<" ";
}
return 0;
}
複製代碼
Vincent
TOP
返回列表
谷哥人營隊
113Scratch夏令營
113年APCS冬令營
113年Scratch冬令營
113年Python研習冬令營
113年Python證照特訓營(一)
113年谷哥人程式體驗營
113年國三專班
113年Python研習夏令營
113年Python證照特訓營(二)
113年程式夏令營(一)(二)
113年APCS夏令營(一)(二)
112年國三專班
112APCS夏令營(一)(二)
112App快速開發夏令營
C語言 / C++ (特別輔導)
C++證照
C#
家教特輔
C語言特輔/證照(家教)
C++證照
C#
HTML5+CSS+JavaScript+PHP+MySQL
Java 家教 (王捷恩)
113新版塊名稱
快樂學 Scratch
Python 家教 (王捷恩 康恒睿)
Python 特別輔導 (家教)
快樂 C++ (家教)
我愛 Java (家教)
程式解題我最行 (家教)
程式常態班
C++ 新生挑戰區
考照心得分享
快樂 C++11307週五19:00
快樂 C++11303 (週六15:40-17:40) 3F
程式解題我最行 (週六15:30-17:30) 3F
快樂 C++ (週六13:30-15:30) 3F
快樂 C++ (週六19:00-21:00) 3F
程式解題我最行 (週六10:00-12:00) 3F
快樂學 Scratch
程式解題我最行(週五19:00-21:00)
快樂 C++ (週六13:30-15:30) 3F
程式解題我最行(週三19:15-21:15)
快樂 C++11207週六10
快樂 C++11208週六19:00
程式解題我最行 (週五19:00-21:00) 3F
快樂 C++ (週六15:30-17:30) 3F
程式解題我最行 (週六19:00-21:00) 3F
程式解題我最行 (週四19:10-21:10)
產投職訓
結訓課程 (產投職訓)
Php & MySQL old
Illustrator old
Dreamweaver old
Android手機程式開發班
PHP & MySQL電子商務互動式網站實作班 (102下)
PHP & MySQL (102上)
PHP & MySQL電子商務互動式網站實作班
Photoshop數位影像設計初階
Flash創意廣告動畫初階
行銷短片視訊剪輯
數位商業攝影實務班
PHP & MySQL電子商務系統開發實務初階班
電子商務系統開發實務中階班
Server基礎架設&動態網頁設計初階班
Java視窗應用程式設計與遊戲開發班
Illustrator時尚插畫創作設計初階班
102上Php & MySQL 初階班
電子商務互動式網站實作中階
Dreamweaver多媒體網頁設計
Android手機程式開發班(2012年10月)
PHP & MySQL (2012年10月)
創意塗鴉
yahoo橫幅
google橫幅
市民學苑
第二屆樂活部落格
第一屆電腦設備簡易維護和故障排除班
專案訓練
電子商務創業班
TQC PHP認證
投資理財班
領隊導遊班
電腦基礎及網路應用身心障礙專班
應用軟體網頁化開發
[收藏此主題]
[關注此主題的新回復]
[通過 QQ、MSN 分享給朋友]