smgr

Untitled

Oct 26th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class negyedik {
  5.     public static void main(String [] args){
  6.        
  7.         int szamok [] = new int [5];
  8.        
  9.         for(int i=0; i<szamok.length; i++){
  10.             szamok[i] = (int)((Math.random()*90)+1);
  11.         }
  12.         Arrays.sort(szamok);
  13.        
  14.         System.out.println("A lottószámok benne vannak a negyedik.txt fájlban");
  15.        
  16.         try{
  17.             PrintWriter kimenet = new PrintWriter(new FileWriter("negyedik.txt"));
  18.             for(int i=0; i<szamok.length; i++)
  19.                 kimenet.println(szamok[i] + " ");
  20.             kimenet.close();
  21.         } catch(IOException e){}
  22.        
  23.        
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment