mashlukashova

Untitled

May 20th, 2019
50
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "Header.h"
  2. using namespace std;
  3. //const int KOL = 3;
  4. class Vektors
  5. {
  6. private:
  7. int Vector_X[3];
  8. int Vector_Y[3];
  9. vector<int> Vector_Z;
  10. public:
  11. // int sozd();
  12. // int set();
  13. //void show();
  14. int set()
  15. {
  16. int n;
  17.  
  18. cout << "vvedite vec1: ";
  19. // n = sizeof(Vector_X)/sizeof(int);
  20.  
  21. for (int i = 0; i < 3; i++){
  22. cin >> Vector_X[i];
  23.  
  24. }
  25. // m = sizeof(Vector_Y)/sizeof(int);
  26. cout << "vvedite vec2: ";
  27. for (int i = 0; i < 3; i++){
  28. cin >> Vector_Y[i];
  29.  
  30. }
  31. cout << "---------------------------------------------------" << endl;
  32. cout << endl;
  33.  
  34. int el;
  35.  
  36. for (int i = 0; i < 3; i++){
  37. for (int j = 0; j < 3; j++){
  38.  
  39. if(i == j) {
  40. el = Vector_X[i] * Vector_Y[j];
  41. Vector_Z.push_back(el);
  42.  
  43. }
  44.  
  45. }
  46.  
  47. }
  48. cout <<"vector Z: "<<endl;
  49. for (int i = 0; i < 3; i++){
  50. cout<< Vector_Z[i] << " ";
  51. }
  52. cout << endl;
  53. return 0;
  54. }
  55.  
  56. void show()
  57. {
  58.  
  59. cout << set() << endl << endl;
  60. }
  61.  
  62.  
  63.  
  64. };
  65.  
  66. /*int Vektors::sozd()
  67. {
  68. int n, m, el;
  69. n = sizeof(Vector_X)/sizeof(int);
  70. // m = sizeof(Vector_Y)/sizeof(int);
  71.  
  72. for (int i = 0; i < n; i++){
  73. for (int j = 0; j < n; j++){
  74.  
  75. if(i != j) continue;
  76. el = Vector_X[i] * Vector_Y[j];
  77. Vector_Z.push_back(el);
  78.  
  79. }
  80.  
  81. }
  82.  
  83. return 0;
  84. }*/
RAW Paste Data