Board logo

標題: 2024/12/21冠毅 [打印本頁]

作者: 郭竑志    時間: 2024-12-21 13:27     標題: 2024/12/21冠毅

本帖最後由 郭竑志 於 2024-12-21 15:28 編輯

[作業檢查]
104 基本認識 (浮點數總和) + 流程圖繪畫
[課堂重點]
105 基本認識 (總和開根號)
106 基本認識 (計算兩點座標的距離)
107 基本認識 (整數輸出)
108 基本認識 (圓面積)
[今日作業]
109 基本認識 (分數判斷)

作者: 劉冠毅    時間: 2024-12-21 14:03

  1. #include<bits/stdc++.h>
  2. using namespace std;

  3. int main()
  4. {
  5.     float o;
  6.     float y;
  7.     float r;

  8.     cout<<"輸入兩個浮點數";
  9.     cin >>o>>y;
  10.     cout<<"兩個浮點數的總和是:";
  11.     r=o+y;
  12.     printf("%.2f\n",r);

  13.     return 0;
  14. }
複製代碼

作者: 劉冠毅    時間: 2024-12-21 14:07

  1. #include<bits/stdc++.h>
  2. using namespace std;

  3. int main()
  4. {
  5.     float o;
  6.     float y;
  7.     float r;


  8.     cin >>o>>y;
  9.     r=o+y;
  10.     r=sqrt(r);
  11.     printf("%.2f\n",r);

  12.     return 0;
  13. }
複製代碼

作者: 劉冠毅    時間: 2024-12-21 15:16

  1. #include<bits/stdc++.h>
  2. using namespace std;

  3. int main()
  4. {


  5.     float o;
  6.     float y;
  7.     float r;
  8.     float j;
  9.     float l;
  10.     float m;
  11.     cin>>o>>y>>r>>j>>l>>m;
  12.     cout<<endl;
  13.     printf("%10.f",o);
  14.     printf("%10.f",y);
  15.     printf("%10.f\n",r);
  16.     printf("%10.f",j);
  17.     printf("%10.f",l);
  18.     printf("%10.f\n",m);

  19.     printf("%-10.f",o);
  20.     printf("%-10.f",y);
  21.     printf("%-10.f\n",r);
  22.     printf("%-10.f",j);
  23.     printf("%-10.f",l);
  24.     printf("%-10.f",m);

  25.     return 0;
  26. }
複製代碼

作者: 劉冠毅    時間: 2024-12-21 15:27

  1. #include<bits/stdc++.h>
  2. using namespace std;

  3. int main()
  4. {


  5.     float o;
  6.     float i;
  7.     cin>>o;
  8.     cout<<o<<endl;
  9.     printf("%.2f\n",o/2);


  10.     i=(o/2)*(o/2)*3.1415;
  11.     printf("%.4f\n",i);


  12.     return 0;
  13. }
複製代碼

作者: 劉冠毅    時間: 2025-1-4 14:05

  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<sstream>
  4. #include<typeinfo>
  5. using namespace std;
  6. int main()
  7. {
  8.     int a;

  9.     cin>>a;
  10.     if(a<0 or a>100){
  11.         cout<<"error";
  12.         return 0;
  13.     }else if(a<60){
  14.         cout<<"fail"<<endl;
  15.     } else if(a>=60){
  16.         cout<<"pass"<<endl;
  17.     }

  18.     if(a%2==0){
  19.         cout<<"even";
  20.     }else{
  21.         cout<<"odd";
  22.     }

  23.     return 0;
  24. }
複製代碼





歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/) Powered by Discuz! 7.2