zoukankan      html  css  js  c++  java
  • 一维数组最大子数组

    package duqu;
      
    import java.io.*;  
    import java.util.Random;  
      
      
    public class AlgorithmTest   
    {     
        public static void main(String[] args)  
        {  
            String filepath = System.getProperty("user.dir");     
            filepath +="./src/number.txt";  
            System.out.println(filepath);  
              
            try   
            {  
                File file = new File(filepath);           
                if(!file.exists())  
                {   //如果不存在data.txt文件则创建  
                    file.createNewFile();  
                    System.out.println("number.txt创建完成");               
                }  
                FileWriter fw = new FileWriter(file);       //创建文件写入  
                BufferedWriter bw = new BufferedWriter(fw);  
                  
                //产生随机数据,写入文件  
                Random random = new Random();  
                for(int i=0;i<100000;i++)  
                {     
                    int randint =(int)Math.floor((random.nextDouble()*2000001-1000000));   //产生0-10000之间随机数          
                    bw.write(String.valueOf(randint));      //写入一个随机数  
                    bw.newLine();       //新的一行  
                }  
                bw.close();  
                fw.close();  
                  
            }   
            catch (Exception e)   
            {  
                e.printStackTrace();  
            }         
        }     
    } 
  • 相关阅读:
    ②.kubernetes service
    c2p
    ⑤.docker dockerfile
    ④.docker volume
    ②.docker image
    ③.docker container
    ①.docker介绍
    三剑客之grep
    ⑦.shell 数组
    shell 正则
  • 原文地址:https://www.cnblogs.com/gkl20173667/p/10614506.html
Copyright © 2011-2022 走看看