Skip to content

Instantly share code, notes, and snippets.

@morontt
Created June 22, 2014 19:36
Show Gist options
  • Save morontt/f4a800508cac00d4703f to your computer and use it in GitHub Desktop.
Save morontt/f4a800508cac00d4703f to your computer and use it in GitHub Desktop.
#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
int i, length;
string s, r;
cout << "string: ";
cin >> s;
r = "";
length = s.length();
for (i = 0; i < length; i++) {
if (s[i] != '*') {
r += s[i];
r += s[i];
}
}
cout << r << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment