Last active
November 6, 2016 20:59
-
-
Save mingl0280/b3886d42cbf2c74b9acf385b1e2f976a 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 <string> | |
#include <sstream> | |
#include <iterator> | |
#include <iostream> | |
using namespace std; | |
string operator*(string &a, int b) | |
{ | |
if (b<=0) return ""; | |
if (b==1) return a; | |
stringstream ss; | |
fill_n(ostream_iterator<const char*>(ss), b, a.c_str()); | |
return ss.str(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment