Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. public class Lab0 {
  2.     public static void main(String args[]){
  3.         int[] k = {16,15,14,13,12,11,10,9,8,7,6,5,4,3,2};
  4.         float[] x = new float[18];
  5.         float[][] c = new float[8][18]
  6.         for (int i=0; i<k.length; i++){
  7.             System.out.println(k[i]);
  8.         }
  9.         for (int i=0; i<x.length; i++) {
  10.             x[i] = (float) Math.random();
  11.         }
  12.         for (int i=0; i<x.length; i++){
  13.             System.out.println(x[i]);
  14.         }
  15.         for (int i=0; i<c.length; i++){
  16.             for (int j = 0; j < c[0]; j++){
  17.                 switch (k[i]){
  18.                     case 12:
  19.                         c[i][j] = Math.sin(Math.pow((x[j]+1) * Math.pow(x[j], x[j])/3));
  20.                         break;
  21.                     case 2:
  22.                     case 4:
  23.                     case 10:
  24.                     case 16:
  25.                         c[i][j] = Math.cos(Math.atan(1/Math.pow(Math.E,Math.abs(x[j]))));
  26.                         break;
  27.                     default:
  28.                         c[i][j] = Math.pow(0,5/Math.pow(2 * Math.atan(Math.pow(x[j]-0.5/19,2)), 3),Math.asin(Math.pow(1/Math.pow(Math.E, Math.abs(x[j])))))
  29.                 }
  30.             }
  31.         }
  32.         /**/
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement