Advertisement
Soverein

Untitled

Feb 1st, 2021
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdlib.h>
  3. #include<math.h>
  4. using namespace std;
  5. int main()
  6. {
  7. double x, y, a = 0, b = 0, c = 0, d = 0;
  8. for (int i=0; i < 3; ++i)
  9. {
  10. cout << "Enter x=" << endl;
  11. cin >> x;
  12. cout << "Enter y= " << endl;
  13. cin >> y;
  14. if (x > 0 && y > 0)
  15. {
  16. ++a;
  17. cout << "the First";
  18. }
  19.  
  20. else if (x < 0 && y>0)
  21. {
  22. ++b;
  23. cout << "the Second";
  24. }
  25.  
  26. else if (x < 0 && y < 0)
  27. {
  28. ++c;
  29. cout << "the Third quarter";
  30. }
  31. else if (x > 0 && y > 0)
  32. {
  33. ++d;
  34. cout << "the Fourth quarter";
  35. }
  36. }
  37. cout << "FIRST= " << a << "\tSecond= " << b << "\tThird= " << c << "\tThourth= " << d<<endl;
  38. int MAX = 0;
  39. if (MAX < a)
  40. {
  41. MAX = a;
  42. }
  43. if (MAX < b)
  44. {
  45. MAX = b;
  46. }
  47. if (MAX < c)
  48. {
  49. MAX = c;
  50. }
  51. if (MAX < d)
  52. {
  53. MAX = d;
  54. }
  55. cout << "max=" <<MAX<< endl;
  56. system("pause");
  57. return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement