fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. // input : s = abcde, c = f
  5.  
  6. void add_char(string s, char c) {
  7. s += c;
  8. }
  9.  
  10. int main() {
  11. string s;
  12. char c;
  13. cin >> s >> c;
  14. add_char(s, c);
  15. cout << s << '\n';
  16. return 0;
  17. }
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout