restructured
This commit is contained in:
parent
c495b7c47f
commit
66cefdfd63
204 changed files with 538 additions and 13662 deletions
24
seminar03_initialization/03_string_multiplication/main.cpp
Normal file
24
seminar03_initialization/03_string_multiplication/main.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
string operator*(const string str, int n) {
|
||||
string result;
|
||||
for (int i = 0; i < n; ++i)
|
||||
result += str;
|
||||
return result;
|
||||
}
|
||||
|
||||
string operator*(int n, const string str) {
|
||||
string result;
|
||||
for (int i = 0; i < n; ++i)
|
||||
result += str;
|
||||
return result;
|
||||
}
|
||||
|
||||
int main() {
|
||||
string meow;
|
||||
cin >> meow;
|
||||
cout << 3 * meow << endl;
|
||||
}
|
||||
Reference in a new issue