Guest User

Untitled

a guest
Feb 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. #include <conio.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. setlocale(0, ".1251");
  9. double y = NULL;
  10. int n;
  11. system("cls");
  12. start:
  13. cout << "Введите значение n: ";
  14. cin >> n;
  15. if (n == 6)
  16. {
  17. y = n * (n - 2)*(n - 1);
  18. }
  19. if (n == 10)
  20. {
  21. y = pow(2, 28 - n);
  22. }
  23. if (n == 18)
  24. {
  25. y = (n-10);
  26. }
  27. if (y == NULL)
  28. {
  29. cout << "Ошибка! Вы ввели неправильное значение.n";
  30. goto start;
  31. }
  32. cout << "y = " << y << "n";
  33. system("pause");
  34. return 0;
  35. }
Add Comment
Please, Sign In to add comment