標題:
2024/12/13 課堂重點(若恩)
[打印本頁]
作者:
郭竑志
時間:
2024-12-13 16:52
標題:
2024/12/13 課堂重點(若恩)
本帖最後由 郭竑志 於 2024-12-13 21:17 編輯
[作業檢查]
104 基本認識 (浮點數總和)
+ 流程圖繪畫
[課堂重點]
105 基本認識 (總和開根號)
106 基本認識 (計算兩點座標的距離)
107 基本認識 (整數輸出)
108 基本認識 (圓面積)
110 基本認識 (比大小)
201 選擇敘述與迴圈 (奇偶數判斷)
202 選擇敘述與迴圈 (分數調整)
203 選擇敘述與迴圈 (相對應的英文單字)
[今日作業]
109 基本認識 (分數判斷)
作者:
何若恩
時間:
2024-12-13 20:22
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
int a, b;
float result;
cin>>a>>b;
result=sqrt(a+b);
cout << "結果=" << fixed << setprecision(2) <<result<< endl;
return 0;
}
複製代碼
作者:
何若恩
時間:
2024-12-13 20:31
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
int a, b, c, d;
float result1,result2,final;
cin>>a>>b>>c>>d;
result1=(a-c)*(a-c);
result2=(b-d)*(b-d);
final=sqrt(result1+result2);
cout << "結果=" << fixed << setprecision(2) <<final<< endl;
return 0;
}
複製代碼
作者:
何若恩
時間:
2024-12-13 20:47
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
int a, b, c, d, e, f;
cout<<"輸入:";
cin>>a>>b>>c>>d>>e>>f;
printf("%10d %10d %10d %10d %10d %10d", a, b, c, d, e, f);
//cout << "結果=" << fixed << setprecision(2) <<final<< endl;
return 0;
}
複製代碼
作者:
何若恩
時間:
2024-12-13 20:56
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
float a, half, area;
cout<<"輸入直徑:";
cin>>a;
half=a/2;
area=half*half*3.1415;
cout << a << endl;
cout << fixed << setprecision(2) << half << endl;
cout << fixed << setprecision(4) << area << endl;
return 0;
}
複製代碼
作者:
何若恩
時間:
2024-12-13 21:06
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
float a, b, c, ans;
cin>>a>>b>>c;
if(60 <= a and a < 100){
cout<<1<<endl;
}else{
cout<<0<<endl;
}
ans=(b+1)/10;
cout << fixed << setprecision(2) << ans << endl;
if(a>=c){
cout<<a<<endl;
}else{
cout<<c<<endl;
}
return 0;
}
複製代碼
作者:
何若恩
時間:
2024-12-13 21:09
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
int a;
cin>>a;
if(a%2==0){
cout<<"even";
}else{
cout<<"odd";
}
return 0;
}
複製代碼
作者:
何若恩
時間:
2024-12-13 21:15
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
int a;
cin>>a;
if(60<a and a<100){
cout<<a+10;
}else if(a<60){
cout<<a+5;
}else{
cout<<"error";
}
return 0;
}
複製代碼
作者:
何若恩
時間:
2024-12-13 21:24
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
int a;
cin>>a;
switch(a){
case 1:
cout<<"one";
break;
case 2:
cout<<"two";
break;
case 3:
cout<<"three";
break;
case 4:
cout<<"four";
break;
default:
cout<<"error";
}
return 0;
}
複製代碼
作者:
何若恩
時間:
2024-12-13 21:28
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
int a;
cin>>a;
if(60<a and a<100){
cout<<"pass"<<endl;
}else if(a<60){
cout<<"fail"<<endl;
}else{
cout<<"error"<<endl;
}
if(a%2==0){
cout<<"even";
}else{
cout<<"odd";
}
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2