Skip to content

Instantly share code, notes, and snippets.

@cjoshmartin
Created December 7, 2017 23:14
Show Gist options
  • Select an option

  • Save cjoshmartin/9f2e9142af7ad929ce75cf906a82539f to your computer and use it in GitHub Desktop.

Select an option

Save cjoshmartin/9f2e9142af7ad929ce75cf906a82539f to your computer and use it in GitHub Desktop.

Revisions

  1. cjoshmartin created this gist Dec 7, 2017.
    33 changes: 33 additions & 0 deletions midi_paser.cpp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    #include <iostream>

    using namespace std;

    int main() {
    std::cout << "Hello, World!" << std::endl;
    string input;
    string output="";
    cout<< endl;
    int i=0;
    while(getline(cin, input)) // will store the the current line from user input into `input` string
    {
    size_t split = input.find(","); // finds the location of the first space
    int numberOfTimes = stoi(input.substr(0,split)); // using the space will store the first half as the 'membername'.
    //cout << numberOfTimes<< endl;

    string restOfString = input.substr(split+1,input.length());
    size_t splitSpace =restOfString.find(" ");
    string songNote = restOfString.substr(0,splitSpace);
    //cout << endl;
    //for(int i=0; i< numberOfTimes;i++) {
    //output +=
    if(i++ <1)
    {
    cout << endl;
    }
    cout<< songNote + ",";
    // }
    //cout <<"\n"<< output << endl;
    }

    return 0;
    }