×
解除綁定,重新設定系統帳號的密碼
您的系統帳號 ID:
您的系統帳號:
您的帳號暱稱:
設定新密碼:
設定新密碼:
×
請輸入要加入的「課程代碼」
請向開設課程的使用者索取「課程代碼」
分類題庫
解題動態
排行榜
討論區
競賽區
登入
註冊
發表新討論
#55681: c++解法
61247091s@gapps.ntnu.edu.tw
(wei)
學校:
不指定學校
編號:
244449
×
傳送站內訊息
傳給:
主題:
內容:
來源:
[123.192.182.169]
註冊時間:
2023-09-07 14:39:22
最後登入時間:
2025-11-28 22:26:54
b861.
葡萄
--
105學年度板橋高中校內資訊學科能力競賽(二)
| From: [123.192.179.85] | 發表日期: 2026-08-02 22:57
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
string s;
cin>>t;
getline(cin,s);
while(t--){
string s,tmp;
getline(cin,s);
stringstream ss(s);
int eat=0,to=0;
bool douto=false;
while(ss>>tmp){
if(tmp=="chi")eat++;
else if(tmp=="tu")to++;
if(to>eat)douto=true;
}
if(eat>to&&!douto){cout<<"chi pu tao bu tu pu tao pi"<<endl;continue;}
if(eat>to&&douto){cout<<"chi pu tao bu tu pu tao pi, bu chi pu tao dao tu pu tao pi"<<endl;continue;}
if(douto){cout<<"bu chi pu tao dao tu pu tao pi"<<endl;continue;}
cout<< "chi pu tao tu pu tao pi"<<"\n";
}
return 0;
}