Advertisement
Ann1ks

Untitled

Mar 18th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. //////////////6///////////////////
  8. int x = 5;
  9. int y = -6;
  10. int z;
  11. if (x > y)
  12. z = x + y;
  13. else
  14. z = y - x;
  15. cout << "z=" << z << endl;
  16. ///////////////7////////////////////
  17. int a;
  18. int b;
  19. cout << "Input a:";
  20. cin >> a;
  21. if (a >= 0)
  22. b = 4;
  23. else
  24. b = -4;
  25. cout << "b=" << b << endl;
  26. ////////////////////8///////////////////
  27. int y;
  28. int x;
  29. cout << "Input x:";
  30. cin >> x;
  31. if (x > 7)
  32. y = x - 3;
  33. else if (x < -5)
  34. y = 4 * pow(x, 2);
  35. else
  36. y = 5;
  37. //////////////////9///////////////////////
  38. int x;
  39. cout << "input x:";
  40. cin >> x;
  41. if (x >= -5 && x < 5)
  42. cout << "on segment\n";
  43. else
  44. cout << "not on segment\n";
  45. ////////////////////////10/////////////////////
  46. int a;
  47. int b;
  48. cout << "input a:";
  49. cin >> a;
  50. cout << "input b:";
  51. cin >> b;
  52. if ((a < 0 && b < 0) && (a > b))
  53. {
  54. a *= 2;
  55. b *= 2;
  56. }
  57. else
  58. {
  59. a += 2;
  60. b += 2;
  61. }
  62. cout << "a=" << a <<endl;
  63. cout << "b=" << b << endl;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement