Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.util.*;
- public class negyedik {
- public static void main(String [] args){
- int szamok [] = new int [5];
- for(int i=0; i<szamok.length; i++){
- szamok[i] = (int)((Math.random()*90)+1);
- }
- Arrays.sort(szamok);
- System.out.println("A lottószámok benne vannak a negyedik.txt fájlban");
- try{
- PrintWriter kimenet = new PrintWriter(new FileWriter("negyedik.txt"));
- for(int i=0; i<szamok.length; i++)
- kimenet.println(szamok[i] + " ");
- kimenet.close();
- } catch(IOException e){}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment