Click
Here to go back to the homepage.
Preludes Solution:
#include <bits/stdc++.h>
using namespace std;
int main(){
// #ifndef TESTING
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
map<string, string> notes = {{"A#", "Bb"}, {"C#", "Db"}, {"D#", "Eb"}, {"F#", "Gb"}, {"G#", "Ab"}};
for(auto i:notes){
notes.insert({i.second, i.first});
}
int caseNumber = 0;
string note, tone;
while(cin >> note >> tone){
auto it = notes.find(note);
if(it == notes.end()){
cout << "Case " << ++caseNumber << ": UNIQUE" << endl;
} else {
cout << "Case " << ++caseNumber << ": " << (*it).second << " " << tone << endl;
}
}
return 0;
}