Created
December 7, 2017 23:14
-
-
Save cjoshmartin/9f2e9142af7ad929ce75cf906a82539f to your computer and use it in GitHub Desktop.
This file contains 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 characters
#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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment