Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Laba2_1;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- double y, a;
- Scanner inp = new Scanner(System.in);
- System.out.print("a=");
- a = inp.nextDouble();
- inp.close();
- if ((a == -1) | (1 <= a & a <= 3)) {
- y = Math.sqrt(Math.pow(Math.sin(a), 2));
- } else if ((5 <= a & a <= 14) | (a == 29.35) | (a >= 80)) {
- y = 2 + Math.cbrt(a + 1);
- } else if ((a < -20) | ((a == 20.44))) {
- y = Math.pow(a, 2) + 2;
- } else {
- y = 1 - a;
- }
- System.out.printf("y=%1.4f", y);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement