-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMain.java
More file actions
40 lines (38 loc) · 1.25 KB
/
Main.java
File metadata and controls
40 lines (38 loc) · 1.25 KB
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
39
40
import static java.lang.Math.*;
// First Lab //
class Main {
public static void main(String[] args) {
long[] t = new long[11];
for (int i = 0, j = 2; i < t.length; ++i, j += 2){
t[i] = j;
System.out.println(t[i]);
}
double[] x = new double[12];
for (int i = 0; i < x.length; ++i){
x[i] = (double) ((random() * 18) - 15 );
System.out.println(x[i]);
}
double[][] m = new double[11][12];
for (int i = 0; i < m.length; ++i){
for (int j = 0; j < m[i].length; ++j){
switch ((int) t[i]) {
case 20:
m[i][j] = asin(pow(E, pow(-abs(t[i]) , 1.0/3.0)));
break;
case 2:
case 4:
case 8:
case 10:
case 18:
m [i][j] = sin(tan(pow(t[i] , 1.0/3.0)));
break;
default:
m[i][j] = pow(E, atan(cos(pow(E , t[i]/4.0))));
}
System.out.printf("%8.5f ", m[i][j]);
}
System.out.println();
}
System.out.println("Всё!");
}
}