fork download
  1. #include<iostream>
  2. #include<windows.h>
  3.  
  4.  
  5. using namespace std;
  6.  
  7. struct Worker
  8. {
  9. char name[20];
  10. int age;
  11. int exp;
  12. };
  13.  
  14. Worker* Array(Worker* Obj, const int n)
  15. {
  16. Obj = new Worker[n];
  17. return Obj;
  18. }
  19.  
  20. void Input(Worker* Obj, const int i)
  21. {
  22. cout << "Ôàìèëèÿ: ";
  23. cin.getline(Obj[i].name, 20);
  24. cout << "Âîçðàñò: ";
  25. cin >> Obj[i].age;
  26. cout << "Îïûò ðàáîòû: ";
  27. cin >> Obj[i].exp;
  28. cin.get();
  29. cout << endl;
  30. }
  31.  
  32.  
  33. void Output(const Worker* Obj, const int n, const int N)
  34. {
  35. system("cls");
  36. cout << "Ôàìèëèÿ\t" << "Ãîä ðîæäåíèÿ\t" << "Ñòàæ\t" << endl;
  37. cout << "========================================" << endl;
  38.  
  39.  
  40. for (int j = 0; j < n; j++)
  41. for (int i = 0; i < N; i++){
  42. cout << Obj[i].name << Obj[i].age << Obj[i].exp << '\t' << " / " << '\t';
  43. }
  44. cout << endl;
  45. }
  46.  
  47. int main()
  48. {
  49. SetConsoleCP(1251);
  50. SetConsoleOutputCP(1251);
  51.  
  52. Worker* Link = 0;
  53. int n, N;
  54.  
  55. cout << "Ââåäèòå ðàçìåð ìàòðèöû: :";
  56. cin >> n;
  57. cin.get();
  58. N=n;
  59. n*=n;
  60.  
  61. Link = Array(Link, n);
  62.  
  63. for (int i=0; i < n; i++){
  64. Input(Link, i);
  65.  
  66. }
  67.  
  68. Output(Link, n, N);
  69.  
  70. delete[] Link;
  71. return 0;
  72. }
  73.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:21: fatal error: windows.h: No such file or directory
compilation terminated.
stdout
Standard output is empty