zoukankan      html  css  js  c++  java
  • java抽奖

    package shisan;
    
    import java.util.Random;
    
    public class choujiang {
    
        public static void main(String[] args) {
            // TODO 自动生成的方法存根
    
        Random o=new Random();
        int []a=new int [7];
        for (int i=1;i<7;i++)
        {
            a[i]=o.nextInt(36);        
            for (int j=1;j<i;j++)
            {                
                    if(a[i]==a[j])
                    {
                        i--;
                    }    
                    
            }
        }
        for (int i=1;i<7;i++)
        System.out.println(a[i]);
        }
    }
        

  • 相关阅读:
    Serialize&Deserialize
    Async&Await
    Generic
    Enum
    Array
    String
    Nullable
    Collection
    Class&Struct
    Interface
  • 原文地址:https://www.cnblogs.com/dandan1224/p/5872661.html
Copyright © 2011-2022 走看看