Advertisement
Soverein

Untitled

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