fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void puts(const string& word, const string& guess) {
  6. for (char c : word)
  7. cout << (guess.find(c) == string::npos ? '*' : c);
  8. }
  9.  
  10. int main() {
  11. puts("This is the guessed string", "si");
  12. }
  13.  
Success #stdin #stdout 0s 4400KB
stdin
Standard input is empty
stdout
**is*is********ss***s**i**