CopyPastor

Detecting plagiarism made easy.

Score: 0.8993135830189319; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-06-06
by gsamaras

Original Post

Original - Posted on 2011-03-06
by kev



            
Present in both answers; Present only in the new answer; Present only in the old answer;

#include <vector> #include <string> #include <sstream> int main() { std::string str("4 99 34 56 28"); std::string buf; // Have a buffer string std::stringstream ss(str); // Insert the string into a stream std::vector<int> tokens; // Create vector to hold our words while (ss >> buf) tokens.push_back(std::stoi(buf)); return 0; }
#include <vector> #include <string> #include <sstream> int main() { std::string str("Split me by whitespaces"); std::string buf; // Have a buffer string std::stringstream ss(str); // Insert the string into a stream std::vector<std::string> tokens; // Create vector to hold our words while (ss >> buf) tokens.push_back(buf);
return 0; }


        
Present in both answers; Present only in the new answer; Present only in the old answer;