Advertisement
gasaichan

Untitled

Mar 7th, 2018
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int main()
  5. {
  6. setlocale(LC_CTYPE,"Russian");
  7. double x,y;
  8. cout << "x = ";cin >> x;
  9. cout << std::abs((float)cos(x)) << endl;
  10. cout << cos(x) << endl;
  11. if(x>1) y=1+sqrt(std::abs(cos(x)));
  12. else if((x>=(-0.5))&&(x<=1)) y=x+1;
  13. else if(x<(-0.5)) y=1-x*x;
  14. cout <<"y = " << y << endl;
  15. cin >> x;
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement