fork download
  1. #include "header.h"
  2. #include <cstdio>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. printf("\nPROI - ZAD1\nNAZWISKO PROWADZACEGO\n\n\n");
  8. int menu;
  9. int a, b, c, d;
  10. int menu2;
  11. printf("Quantity of:\n[i 0]\n[0 -i] - is Afactor \n[0 1]\n[-1 0] - is Bfactor \n[0 i]\n[i 0] - is Cfactor");
  12. printf("CHOOSE VALUE OF FACTORS\nA ");
  13. scanf("%d", &a);
  14. printf("B ");
  15. scanf("%d", &b);
  16. printf("C ");
  17. scanf("%d", &c);
  18. printf("D ");
  19. scanf("%d", &d);
  20. bool constructoron;
  21. Quaternion *first = new Quaternion(a, b, c, d);
  22. Quaternion second(a,b,c,d);
  23. Quaternion third(a,b,c,d);
  24. constructoron = false;
  25. while (menu != 7)
  26. {
  27. if (constructoron = false)
  28. printf("CHOOSE OPTION:\n(1) - ADDING\n(2) - SUBTRACTING\n(3) - MULTIPLYING\n(4) - MODULE\n(5) - CONSTRUCTOR/DESTRUCTOR ON\n(6) - END");
  29. else
  30. printf("CHOOSE OPTION:\n(1) - ADDING\n(2) - SUBTRACTING\n(3) - MULTIPLYING\n(4) - MODULE\n(5) - CONSTRUCTOR/DESTRUCTOR OFF\n(6) - END");
  31. cin>>menu;
  32. while (menu != 1 && menu != 2 && menu != 3 && menu != 4 && menu != 5 && menu != 6)
  33. {
  34. printf("INVALID VALUE!\n");
  35. if (constructoron = false)
  36. printf("CHOOSE OPTION:\n(1) - ADDING\n(2) - SUBTRACTING\n(3) - MULTIPLYING\n(4) - MODULE\n(5) - CONSTRUCTOR/DESTRUCTOR ON\n(6) - END");
  37. else
  38. printf("CHOOSE OPTION:\n(1) - ADDING\n(2) - SUBTRACTING\n(3) - MULTIPLYING\n(4) - MODULE\n(5) - CONSTRUCTOR/DESTRUCTOR OFF\n(6) - END");
  39. cin>>menu;
  40. }
  41. switch(menu)
  42. {
  43. case 1:
  44. printf("CHOOSE VALUE OF FACTORS OF QUATERNIONS WHICH YOU WILL ADD\nA ");
  45. scanf("%d", &a);
  46. printf("B ");
  47. scanf("%d", &b);
  48. printf("C ");
  49. scanf("%d", &c);
  50. printf("D ");
  51. scanf("%d", &d);
  52. second = Quaternion (a, b, c, d);
  53. printf("CHOOSE OPTION:\n(1) - +\n(2) - += ");
  54. scanf("%d", &menu2);
  55. while (menu2 != 1 && menu2 != 2)
  56. {
  57. printf("INVALID VALUE!\n");
  58. printf("CHOOSE OPTION:\n(1) - +\n(2) - += ");
  59. scanf("%d", &menu2);
  60. }
  61. if (menu2 = 1)
  62. {
  63. third = *first + second;
  64. cout<<third;
  65. }
  66. else
  67. {
  68. *first += second;
  69. cout<<first;
  70. }
  71. break;
  72. case 2:
  73. printf("CHOOSE VALUE OF FACTORS OF QUATERNION WHICH YOU WILL SUBSTRACT\nA ");
  74. scanf("%d", &a);
  75. printf("B ");
  76. scanf("%d", &b);
  77. printf("C ");
  78. scanf("%d", &c);
  79. printf("D ");
  80. scanf("%d", &d);
  81. second = Quaternion (a, b, c, d);
  82.  
  83. printf("CHOOSE OPTION:\n(1) - -\n(2) - -= ");
  84. scanf("%d", &menu2);
  85. while (menu2 != 1 && menu2 != 2)
  86. {
  87. printf("INVALID VALUE!\n");
  88. printf("CHOOSE OPTION:\n(1) - -\n(2) - -= ");
  89. scanf("%d", &menu2);
  90. }
  91. if (menu2 = 1)
  92. {
  93. third = *first - second;
  94. cout<<third;
  95. }
  96. else
  97. {
  98. *first -= second;
  99. cout<<first;
  100. }
  101. break;
  102. case 3:
  103. printf("CHOOSE VALUE OF FACTORS OF QUATERNION WHICH YOU WANT TO MULTIPLY BY\nA ");
  104. scanf("%d", &a);
  105. printf("B ");
  106. scanf("%d", &b);
  107. printf("C ");
  108. scanf("%d", &c);
  109. printf("D ");
  110. scanf("%d", &d);
  111. second = Quaternion (a, b, c, d);
  112.  
  113. printf("CHOOSE OPTION:\n(1) - *\n(2) - *= ");
  114. scanf("%d", &menu2);
  115. while (menu2 != 1 && menu2 != 2)
  116. {
  117. printf("INVALID VALUE!\n");
  118. printf("CHOOSE OPTION:\n(1) - *\n(2) - *= ");
  119. scanf("%d", &menu2);
  120. }
  121. if (menu2 = 1)
  122. {
  123. third = *first * second;
  124. cout<<third;
  125. }
  126. else
  127. {
  128. *first *= second;
  129. cout<<first;
  130. }
  131. break;
  132. case 4:
  133. first module();
  134. cout<<first;
  135. break;
  136. case 5:
  137. if (constructoron = true)
  138. constructoron = false;
  139. else constructoron = true;
  140. break;
  141. case 6:
  142. exit(1);
  143. }
  144. }
  145. return 0;
  146. }
  147.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:20: fatal error: header.h: No such file or directory
 #include "header.h"
                    ^
compilation terminated.
stdout
Standard output is empty