SHARE
TWEET

Untitled

a guest Oct 21st, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. class BirthdayParadox {
  5.     public static void main (String[] args) {
  6.         Scanner sc=new Scanner(System.in);
  7.        
  8.        
  9.         int n=0;
  10.         float num=365;
  11.         float den=365;
  12.         float p=1;
  13.         while(p>0.5){
  14.             p=p*(num/den);
  15.             num--;
  16.             n++;
  17.         }
  18.         System.out.println(n);
  19.     }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top