標題:
2025/5/10冠毅
[打印本頁]
作者:
郭竑志
時間:
5 天前 14:31
標題:
2025/5/10冠毅
本帖最後由 郭竑志 於 2025-5-10 15:31 編輯
[今日考試]
105 基本認識 (總和開根號)
305 函式與陣列 (運算判斷)
403 字串與檔案處理 (字串大小寫轉換)
[今日作業]
301~305
作者:
劉冠毅
時間:
5 天前 14:43
本帖最後由 劉冠毅 於 2025-5-10 15:22 編輯
#include<bits/stdc++.h>
using namespace std;
int main()
{
float i,o,l;
cin>>i>>o;
l=i+o;
cout<<"result=";
printf("%.2f\n",sqrt(l));
//更號 i+o
return 0;
}
複製代碼
作者:
劉冠毅
時間:
5 天前 14:59
本帖最後由 劉冠毅 於 2025-5-10 15:29 編輯
#include<bits/stdc++.h>
using namespace std;
void compute(int i[3]){
//索引值1=1 索引值0+索引值2
if(i[1]==1){
cout<<i[0]+i[2];
}else{
cout<<i[0]*i[2];
//索引值1=1 索引值0x索引值2
}
}
int main()
{
int i[3]={0};
for(int o=0;o<=2;o++){
cin>>i[o];
//輸出
}
compute(i);
return 0;
}
複製代碼
作者:
劉冠毅
時間:
5 天前 15:18
本帖最後由 劉冠毅 於 2025-5-10 15:25 編輯
#include<bits/stdc++.h>
using namespace std;
int main()
{
string str;
getline(cin,str);
for(int i=0;i<str.length();i++){
if(str[i]>=65 && str[i]<=90){
str[i]=str[i]+32;
//大寫變小寫
}else{
str[i]=str[i]-32;
//小寫變大寫
}
}
for(int i=0;i<str.length();i++){
cout<<str[i];
}
return 0;
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2