Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5.  
  6. int main()
  7. {
  8. int x, z;
  9. cout << "x=";
  10. cin >> x;
  11. cout << "z=";
  12. cin >> z;
  13. int a = 5;
  14.  
  15. if (x - a <= 3)
  16. {
  17. z = z + 2;
  18. if (x == a || x == 0)
  19. {
  20. a = a - 2;
  21. z = z - 2 * x;
  22.  
  23. }
  24. else
  25. {
  26. z = (z - x)*a;
  27. }
  28. z = 7 * z - 3;
  29. }
  30. else
  31. {
  32. int n = 4 + 2 * a;
  33. for (int k = 1; k < n; k++)
  34. {
  35. z = k - 4 * x*z;
  36. if (x < a + 7)
  37. {
  38. z = z + 3 * k;
  39. }
  40. }
  41. }
  42. cout << "z=" << z << endl;
  43.  
  44.  
  45. system("pause");
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement