fork(1) download
  1. #include <iostream>
  2. #include <string>
  3. #include <stdio.h>
  4. #include <conio.h>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. setlocale(LC_ALL, "Russian");
  11.  
  12. string first_name;
  13. string letter_intro;
  14. string friend_name;
  15. char friend_sex;
  16. int age;
  17.  
  18. friend_sex = 0;
  19. age = 0;
  20.  
  21. cout << "Enter an addressant name: ";
  22. getline(cin, first_name);
  23. cout << "Enter an introduction of the letter: ";
  24. getline(cin, letter_intro);
  25. cout << "Enter the name of your best friend: ";
  26. getline(cin, friend_name);
  27. cout << "Enter sex of your best friend: ";
  28.  
  29. while ( (friend_sex != 'm') && (friend_sex != 'f') )
  30. {
  31. cin >> friend_sex;
  32. cout << "Enter f or m: ";
  33. }
  34.  
  35. cout << "Enter age of the addressant: ";
  36. cin >> age;
  37.  
  38. if (0 <= age <= 110)
  39. {
  40. cin >> age;
  41. cout << "You're kidding!";
  42. }
  43.  
  44. cout << "Dear "
  45. << first_name
  46. << ". "
  47. << letter_intro
  48. << " Haven't you seen "
  49. << friend_name
  50. << " lately? ";
  51.  
  52. if (friend_sex == 'm')
  53. {
  54. cout << "If you'll see " << friend_name << " tell him please to call me.";
  55. }
  56. if (friend_sex == 'f')
  57. {
  58. cout << "If you'll see " << friend_name << " tell her please to call me.";
  59. }
  60.  
  61. cout << "\nI heard that you just celebrate your birthdate and you are " << age << " years old!";
  62.  
  63.  
  64. _getch();
  65. return 0;
  66. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4:19: fatal error: conio.h: No such file or directory
compilation terminated.
stdout
Standard output is empty