fork download
  1. #include <vector>
  2.  
  3. class Melodies {
  4. public:
  5. struct Note {
  6. int note;
  7. int duration;
  8.  
  9. Note(int a, int b) : note(a), duration(b) {}
  10. };
  11.  
  12. struct Melody {
  13. std::vector<Melodies::Note> notes;
  14.  
  15. void addNote(Melodies::Note note) {
  16. notes.push_back(note);
  17. }
  18. };
  19.  
  20. static void begin();
  21.  
  22. static Melodies::Melody NONE;
  23. static Melodies::Melody BILL;
  24. static Melodies::Melody COIN;
  25. };
  26.  
  27. Melodies::Melody Melodies::NONE = {};
  28. Melodies::Melody Melodies::BILL = {};
  29. Melodies::Melody Melodies::COIN = {};
  30.  
  31. int main() {
  32. Melodies::COIN.addNote(Melodies::Note(4, 5));
  33. return 0;
  34. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty