fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. namespace pers
  5. {
  6. using std::cout;
  7. using std::cin;
  8.  
  9. struct Person
  10. {
  11. std::string fname;
  12. std::string lname;
  13. };
  14.  
  15. void getPerson(Person & rp)
  16. {
  17. cout << "Enter first name: ";
  18. cin >> rp.fname;
  19. cout << "Enter last name: ";
  20. cin >> rp.lname;
  21. }
  22. }
  23.  
  24. namespace debts
  25. {
  26. struct Debt
  27. {
  28. pers::Person name;
  29. double amount;
  30. };
  31.  
  32. void getDebt(Debt & rd)
  33. {
  34. getPerson(rd.name);
  35. std::cout << "Enter debt: ";
  36. std::cin >> rd.amount;
  37. }
  38. }
  39.  
  40. int main() {
  41. // your code goes here
  42. return 0;
  43. }
Success #stdin #stdout 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty