Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. import java.util.Random;
  2. public class wektor_test
  3. {
  4.     public static void main(){
  5.         Wektor w[]= new Wektor[10];
  6.         Wektor wx= new Wektor(1.0,1.0,1.0);
  7.         System.out.println(wx.dlugosc());
  8.         Random los = new Random();
  9.         double x=0;
  10.         double y=0;
  11.         double z=0;
  12.         double min_dl=9999999;
  13.  
  14.        // System.out.printf(" %2.2f ",x);
  15.  
  16.         for(int i=0; i<w.length;i++){
  17.             x=los.nextDouble()*100;
  18.             y=los.nextDouble()*100;
  19.             z=los.nextDouble()*100;
  20.             w[i]= new Wektor(x,y,z);
  21.             double temp=w[i].dlugosc();
  22.             if(temp<min_dl){min_dl=temp;}
  23.             System.out.println(w[i]);
  24.  
  25.         }
  26.         System.out.print(min_dl);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement