Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added main
Binary file not shown.
11 changes: 10 additions & 1 deletion main.c → main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ using namespace std;
// result -> envelope
string surroundWithCharacter(string str, char c) {
// TODO
str += c;

for(int i = str.size() ; i > 0 ; i--){
str[i] = str[i-1];
}

str[0] = c;
str += c;

return str;
}

int main() {
string str;
cout << "Enter the string:" << endl;
Expand Down