file1.cpp 591 B

1234567891011121314151617181920212223242526
  1. // file1.cpp -- example of a three-file program
  2. #include <iostream>
  3. #include "coordin.h" // structure templates, function prototypes
  4. using namespace std;
  5. int main()
  6. {
  7. rect rplace;
  8. polar pplace;
  9. cout << "Enter the x and y values: ";
  10. while (cin >> rplace.x >> rplace.y) // slick use of cin
  11. {
  12. pplace = rect_to_polar(rplace);
  13. show_polar(pplace);
  14. cout << "Next two numbers (q to quit): ";
  15. }
  16. cout << "Bye!\n";
  17. // keep window open in MSVC++
  18. /*
  19. cin.clear();
  20. while (cin.get() != '\n')
  21. continue;
  22. cin.get();
  23. */
  24. return 0;
  25. }