Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package proj1;
- import java.text.DecimalFormat;
- public class P44_45_46
- {
- public static void main(String[] args)
- {
- //4.4
- DecimalFormat df = new DecimalFormat();
- df.setMaximumFractionDigits(8);
- double chance = (6D/49D) * (5D/48D) * (4D/ 47D) * (3D/46D) * (2D/45D) * (1D/44D) ;
- System.out.println ("The chance of winning at 6/49 is : " + df.format(chance) + "%" +'\n');
- //4.5
- // int max = 49;
- // int min = 1;
- // int range = max - min + 1;
- // int[] list = new int [6];
- //
- // for (int i = 0; i < 6; i++)
- // {
- // list[i] = (int)(Math.random() * range) + min;
- // }
- // for (int i = 0; i < 6; i++)
- // {
- // System.out.println(list[i] + '/n');
- // }
- //4.6
- int max = 49;
- int min = 1;
- int range = max - min + 1;
- long pack ;
- for (int i = 0; i < 5; i++)
- {
- pack = ((long) (Math.random() * range) + min ) << 6 ;
- }
- pack = ((long) (Math.random() * range) + min );
- // pack poate ajunge la 36 de biti care e mai mare decat long ?????
- int nmin = 0 ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement