-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLab1.java
38 lines (33 loc) · 1.18 KB
/
Lab1.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.Scanner;
import static java.lang.Math.sqrt;
import static java.lang.Math.asin;
import static java.lang.Math.abs;
import static java.lang.Math.pow;
import static java.lang.Math.log;
import static java.lang.Math.sin;
import static java.lang.Math.cos;
public class Lab1 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int variable_x = scanner.nextInt();
double variable_y = part1(variable_x) + part2(variable_x) + part3(variable_x);
double hypotenuse = sqrt(pow(variable_x, 2)+pow(variable_y, 2));
if (hypotenuse<5 && variable_x>=0){
System.out.print(true);
} else {
System.out.print(false);
}
}
private static double part1(int variable){
double result = asin(pow(sqrt(abs(variable))/(sqrt(abs(variable)+1)), 5));
return result;
}
private static double part2(int variable){
double result = pow(pow(variable, 2) + 1, 1.0/5);
return result;
}
private static double part3(int variable){
double result = log(pow(2, sin(variable)+abs(pow(variable, cos(variable)))))/log(2.0);
return result;
}
}