fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6. float n,x;
  7. cin>>n;
  8. if (n == 1){
  9. x=sqrt(2*n);
  10. }
  11. else
  12. if (n==2){
  13. x=pow(n,3)-5;
  14. }
  15. else
  16. if (n==3){
  17. x=cos(n)+1;
  18. }
  19. else
  20. {x=1;
  21. }
  22. cout<<x;
  23. return 0;
  24. }
Success #stdin #stdout 0s 3432KB
stdin
1
stdout
1.41421