fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. string input;
  6. string input2;
  7. printf("What is your name?\n-->");
  8. getline(cin, input);
  9. std::string nameObj = "{ \"name\": \"" + input + "\" }";
  10. cout << nameObj << endl;
  11. printf("What do you want to send?\n-->");
  12. getline(cin, input2);
  13. std::string jsonObj = "{ \"content\": \"" + input2 + "\", \"tts\": true }";
  14. cout << jsonObj << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 2880KB
stdin
Felix
Admin
stdout
What is your name?
-->{ "name": "Felix" }
What do you want to send?
-->{ "content": "Admin", "tts": true }