Advertisement
Guest User

Untitled

a guest
Nov 28th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <iostream>
  2. #include "complex0.h" //complex.h와 혼동을 피하기 위해
  3.  
  4. int main()
  5. {
  6. complex a(3.0, 4.0); // 3.0 + 4.0i
  7. complex c;
  8. cout << "하나의 복소수를 입력하세요(끝내려면 q): \n";
  9. while(cin >> c)
  10. {
  11. cout << "c= " << c << endl;
  12.  
  13. // cout << "공액복소수=" << ~c << endl;
  14. // 공액복소수(=켤레복소수) 실수같고, 허수부분이 부호가 다름.
  15.  
  16. cout << "a = "<< a << endl;
  17. cout << "a+c = " << a+c << endl;
  18. cout << "a-c = " << a-c << endl;
  19. cout << "a*c = " << a*c << endl;
  20. cout << "2*c = " << 2*c << endl;
  21. cout << "하나의 복소수를 입력하세요(끝내려면 q): \n";
  22. }
  23. cout << "프로그램을 종료합니다. \n";
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement