Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package kolo;
- import java.util.Scanner;
- import java.lang.Math;
- public class ta {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int random = (int)(Math.random()*21)+20;
- int liczba=0;
- for(;liczba!=random;)
- {
- System.out.println("Podaj liczbe:");
- liczba = sc.nextInt();
- if(liczba>random)
- System.out.println("Za duzo!");
- else if(liczba<random)
- System.out.println("Za malo!");
- else
- System.out.println("Zgadles!");
- }
- sc.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement