題目大意: 就實作
思路: 建表,然後照要求,觀察一下發現,大三小三最後第2個都一樣。差在大三index+4,小三+3.
C++炫技時間(表演一下輸出塞字串陣列)。😂😂😂 對了python不給過==
代碼:
#include <bits/stdc++.h>
#define Fast cin.tie(0), ios::sync_with_stdio(0)
#define louisfghbvc int t; cin >> t; while(t--)
using namespace std;
void solve(){
string s;
vector<string> lt = {"C","C#","D","D#","E","F","F#","G","G#","A","A#","B"};
cin >> s;
bool gg = 0;
if(s.back() == 'm'){
s.pop_back();
gg = 1;
}
int i = find(lt.begin(), lt.end(), s) - lt.begin();
cout << s << " " << vector<string>{lt[(i+3)%12], lt[(i+4)%12]}[!gg] << " " << lt[(i+7)%12] << "\n";
}
int main()
{
//Fast;
louisfghbvc
solve();
return 0;
}
留言列表