標題:
2025/4/26冠毅
[打印本頁]
作者:
郭竑志
時間:
2025-4-26 13:36
標題:
2025/4/26冠毅
本帖最後由 郭竑志 於 2025-4-26 15:39 編輯
[今日考試]
106 基本認識 (計算兩點座標的距離)
210 選擇敘述與迴圈 (最大公因數與最小公倍數)
306 函式與陣列 (階乘)
402 字串與檔案處理 (字串比較)
[今日作業]
206~210
作者:
劉冠毅
時間:
2025-4-26 14:05
#include<bits/stdc++.h>
using namespace std;
int main()
{
float x1,x2,y1,y2,a,b,c;
cin>>x1>>y1>>x2>>y2;
a=x2-x1;
b=y2-y1;
c=a*a+b*b;
printf("%.2f",sqrt(c));
return 0;
}
複製代碼
作者:
劉冠毅
時間:
2025-5-3 14:16
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,tmp,m=0,h,g;
cin>>a>>b;
h=a;
g=b;
while(b!=0){
tmp=b;
b=a%b;
a=tmp;
}
cout<<a<<endl;
cout<<h*g/a;
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2