Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <math.h>
  4. using namespace std;
  5.  
  6. struct Complex
  7. {
  8. int Re;
  9. int Im;
  10. };
  11. void input();
  12. void output();
  13. int main()
  14. {
  15. int i;
  16. Complex *mas1;
  17. Complex *mas2;
  18. mas1 = new Complex[1];
  19. mas2 = new Complex[1];
  20. input();
  21. output();
  22.  
  23.  
  24. system("pause");
  25. return 0;
  26. };
  27.  
  28. void input()
  29. {
  30. int i;
  31.  
  32. Complex *mas1;
  33. Complex *mas2;
  34.  
  35. mas1 = new Complex[1];
  36. mas2 = new Complex[1];
  37. for (int i = 0; i < 1; i++) {
  38. cout << "First complex ";
  39. cin >> mas1[i].Re >> mas1[i].Im;
  40. ;
  41. }
  42. for (int i = 0; i < 1; i++) {
  43. cout << "Second complex ";
  44. cin >> mas2[i].Re >> mas2[i].Im;
  45.  
  46.  
  47. }
  48.  
  49. };
  50. void output(){
  51.  
  52. Complex *mas1;
  53. Complex *mas2;
  54.  
  55. mas1 = new Complex[1];
  56. mas2 = new Complex[1];
  57. for (int i = 0; i < 1; i++){
  58. cout << ((mas1[i].Re*mas1[i].Im) - (mas2[i].Re*mas2[i].Im));
  59. cout << "+";
  60. cout << (((mas1[i].Re)*(mas2[i].Im)) + ((mas2[i].Re)*(mas1[i].Im)));
  61. cout << "i";
  62.  
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement