Created
December 7, 2017 23:14
-
-
Save cjoshmartin/9f2e9142af7ad929ce75cf906a82539f to your computer and use it in GitHub Desktop.
Revisions
-
cjoshmartin created this gist
Dec 7, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal 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; }