Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Lab1{
- public static void main(String[] args) {
- int [] c = new int[14];
- float [] x = new float[20];
- int schet=15, k = 0;
- while (schet>=2) {
- c[k] = schet;
- schet--;
- k++;
- }
- for (int i = 0; i<20;i++) {
- x[i]=(float) ((Math.random() * 11.0) - 8.0);// <-- (Math.random()*( max - min )) + min
- }
- double [][] t = new double [14][20];
- for (int i = 0; i<14;i++){
- for (int j = 0; j<20;j++) {
- switch (c[i]) {
- case 2:
- case 4:
- case 7:
- case 8:
- case 9:
- case 11:
- case 14:
- t[i][j] = Math.atan(Math.sin(Math.pow(Math.pow(((x[j] + 1) / x[j]), 3), (double)1/3)));
- break;
- case 10:
- t[i][j] = Math.tan(0.5 * Math.pow((0.25 * (x[j] + 0.5)), x[j]));
- break;
- default:
- t[i][j] = Math.pow(Math.cos(Math.pow(Math.E, x[j] * (3 - x[j]))), (double)1/3);
- break;
- }
- System.out.printf("%7.5f", t[i][j]);
- System.out.print(" ");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement