Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package tomb;
- import java.util.Scanner;
- public class Tomb {
- public static void kiir(int[] k) {
- for (int n : k) {
- System.out.print(n + ", ");
- }
- }
- public static int[] csere(int max, int min) {
- int[] cserelo = new int[2];
- if (max < min) {
- int temp = min;
- min = max;
- max = temp;
- }
- cserelo[0] = max;
- cserelo[1] = min;
- return cserelo;
- }
- public static int[] general(int x, int y) {
- int[] t = new int[100];
- for(int i=0; i<t.length; i++){
- t[i]=(int)(Math.random() * (x-y+1) + y);
- }
- return t;
- }
- public static void main(String[] args) {
- System.out.println("Kerem a max erteket!");
- Scanner read1 = new Scanner(System.in);
- int x = read1.nextInt();
- System.out.println("Kerem a min erteket!");
- Scanner read2 = new Scanner(System.in);
- int y = read2.nextInt();
- // int[] cserelt = csere(x,y);
- // int[] szamok = general(cserelt[0], cserelt[1]);
- // kiir(szamok);
- kiir(general(csere(x,y)[0], csere(x,y)[1]));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment