Advertisement
karupayun

tap17/a.cpp

Oct 22nd, 2017
198
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. #define forn(i,n) for(int i=0;i<int(n);i++)
  5.  
  6. string notas[12] = {"DO", "DO#", "RE", "RE#", "MI", "FA", "FA#",
  7.                     "SOL", "SOL#", "LA", "LA#", "SI"};
  8.  
  9. int main(){
  10.     //~ freopen("../io/a_sample4.in", "r", stdin);
  11.     //~ freopen("../io/a_sample4.out", "w", stdout);
  12.     int s, res;
  13.     string n;
  14.     cin >> s >> n;
  15.    
  16.     forn (i, 12)
  17.         if (n == notas[i])
  18.             res = i;
  19.    
  20.     res += 12-s;
  21.     res %= 12;
  22.     cout<<notas[res]<<endl;
  23.     return 0;  
  24. }
Advertisement
RAW Paste Data Copied
Advertisement