標題:
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
#include<bits/stdc++.h>
using namespace std;
int main()
{
float o;
float y;
float r;
cout<<"輸入兩個浮點數";
cin >>o>>y;
cout<<"兩個浮點數的總和是:";
r=o+y;
printf("%.2f\n",r);
return 0;
}
複製代碼
作者:
劉冠毅
時間:
2024-12-21 14:07
#include<bits/stdc++.h>
using namespace std;
int main()
{
float o;
float y;
float r;
cin >>o>>y;
r=o+y;
r=sqrt(r);
printf("%.2f\n",r);
return 0;
}
複製代碼
作者:
劉冠毅
時間:
2024-12-21 15:16
#include<bits/stdc++.h>
using namespace std;
int main()
{
float o;
float y;
float r;
float j;
float l;
float m;
cin>>o>>y>>r>>j>>l>>m;
cout<<endl;
printf("%10.f",o);
printf("%10.f",y);
printf("%10.f\n",r);
printf("%10.f",j);
printf("%10.f",l);
printf("%10.f\n",m);
printf("%-10.f",o);
printf("%-10.f",y);
printf("%-10.f\n",r);
printf("%-10.f",j);
printf("%-10.f",l);
printf("%-10.f",m);
return 0;
}
複製代碼
作者:
劉冠毅
時間:
2024-12-21 15:27
#include<bits/stdc++.h>
using namespace std;
int main()
{
float o;
float i;
cin>>o;
cout<<o<<endl;
printf("%.2f\n",o/2);
i=(o/2)*(o/2)*3.1415;
printf("%.4f\n",i);
return 0;
}
複製代碼
作者:
劉冠毅
時間:
2025-1-4 14:05
#include<iostream>
#include<cstdlib>
#include<sstream>
#include<typeinfo>
using namespace std;
int main()
{
int a;
cin>>a;
if(a<0 or a>100){
cout<<"error";
return 0;
}else if(a<60){
cout<<"fail"<<endl;
} else if(a>=60){
cout<<"pass"<<endl;
}
if(a%2==0){
cout<<"even";
}else{
cout<<"odd";
}
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2