Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #define forn(i,n) for(int i=0;i<int(n);i++)
- string notas[12] = {"DO", "DO#", "RE", "RE#", "MI", "FA", "FA#",
- "SOL", "SOL#", "LA", "LA#", "SI"};
- int main(){
- //~ freopen("../io/a_sample4.in", "r", stdin);
- //~ freopen("../io/a_sample4.out", "w", stdout);
- int s, res;
- string n;
- cin >> s >> n;
- forn (i, 12)
- if (n == notas[i])
- res = i;
- res += 12-s;
- res %= 12;
- cout<<notas[res]<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement