標題:
2025/3/28 課堂重點(若恩)
[打印本頁]
作者:
郭竑志
時間:
2025-3-28 20:28
標題:
2025/3/28 課堂重點(若恩)
本帖最後由 郭竑志 於 2025-3-28 20:30 編輯
[課堂重點]
503 區間運算
504 迴文數
505 公式計算
506 質因數分解
[今日作業]
複習101~110 (t001~t010)
作者:
何若恩
時間:
2025-3-28 20:51
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
int a, b;
cin>>a>>b;
for(int i=1;i<a;i++){
if(sqrt(i)==int(sqrt(i))){
int j;
j=pow(i,b);
j=sqrt(j);
cout<<j<<endl;
}
}
return 0;
}
複製代碼
作者:
何若恩
時間:
2025-3-28 21:20
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
string s,a;
cin>>s;
for(int i=0, j=s.length()-1;i<s.length();i++, j--){
s[i]=a[j];
}
if(s==a){
cout<<"Yes";
}else{
cout<<"No";
}
return 0;
}
複製代碼
作者:
何若恩
時間:
2025-3-29 21:40
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
float a;
cin>>a;
a=a*23.34;
printf ("%.2f", a);
return 0;
}
複製代碼
作者:
何若恩
時間:
2025-3-29 21:41
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
int a;
cin>>a;
cout<<a+9;
return 0;
}
複製代碼
作者:
何若恩
時間:
2025-3-29 21:47
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
float a, b, c;
float mean;
cin>>a>>b>>c;
cout<<a<<"+"<<b<<"+"<<c<<"="<<a+b+c<<endl;
mean=(a+b+c)/3;
printf ("%.2f", mean);
return 0;
}
複製代碼
作者:
何若恩
時間:
2025-3-29 21:50
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
float a, b;
float total;
cin>>a>>b;
total=a+b;
cout<<"total=";
printf ("%.2f", total);
return 0;
}
複製代碼
作者:
何若恩
時間:
2025-3-29 21:55
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
float a, b;
float result;
cin>>a>>b;
result=a+b;
result=pow(result,0.5);
cout<<"result=";
printf ("%.2f", result);
return 0;
}
複製代碼
作者:
何若恩
時間:
2025-3-29 22:04
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
float a, b, c, d;
float x, y, result;
cin>>a>>b>>c>>d;
x=pow(c-a,2);
y=pow(d-b,2);
result=pow(x+y,0.5);
printf ("%.2f", result);
return 0;
}
複製代碼
作者:
何若恩
時間:
2025-4-10 21:04
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
float a, b, c, d, e, f, ans;
cin>>a>>b>>c>>d>>e>>f;
ans=abs(a)*int(b)+pow(c,d)*sqrt(e)+log10(f);
printf("%.2f", ans);
return 0;
}
複製代碼
作者:
何若恩
時間:
2025-4-11 20:50
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
int n;
cin>>n;
for(int i=2;i<n;i++){
while(n%i==0){
n/=i;
cout<<i<<"*";
}
}
for(int i=2;i<=n;i++){
while(n%i==0){
n/=i;
cout<<i;
}
}
return 0;
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://www.istak.org.tw/seed/)
Powered by Discuz! 7.2