Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. package Laba2_1;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.     public static void main(String[] args) {
  7.         double y, a;
  8.  
  9.         Scanner inp = new Scanner(System.in);
  10.         System.out.print("a=");
  11.         a = inp.nextDouble();
  12.         inp.close();
  13.  
  14.  
  15.         if ((a == -1) | (1 <= a & a <= 3)) {
  16.             y = Math.sqrt(Math.pow(Math.sin(a), 2));
  17.         } else if ((5 <= a & a <= 14) | (a == 29.35) | (a >= 80)) {
  18.             y = 2 + Math.cbrt(a + 1);
  19.         } else if ((a < -20) | ((a == 20.44))) {
  20.             y = Math.pow(a, 2) + 2;
  21.         } else {
  22.             y = 1 - a;
  23.         }
  24.  
  25.             System.out.printf("y=%1.4f", y);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement