Lottery code implementation

public  class Demo {
     public  static  void main (String [] args) {
         // one percent chance of winning is possible 
        for ( int I = 0; I <100; I ++ ) {
             IF (Math.random ()> 0.99 ) {
                System.out.println ( "Congratulations, you won the lottery" );
            }
        }
    }
}

Guess you like

Origin www.cnblogs.com/LangKeZ/p/12148625.html