Import java util. Random; import java util. Scanner


Download 13.1 Kb.
Sana11.02.2023
Hajmi13.1 Kb.
#1190213
Bog'liq
import java


import java.util.Random;
import java.util.Scanner;

public class dars {


public static Scanner sc=new Scanner(System.in);

public static void main(String[] args) {


Random random=new Random();
int a=Math.abs(random.nextInt()%100);
while (!tekshirish(a)){

}
}
public static boolean tekshirish(int m){


int f= sc.nextInt();
if(f==m){
System.out.println("To'g'ri");
return true;
}
else {
if (f>m) System.out.println("Katta son kiritdigiz");
else System.out.println("Kichik son kiritdigiz");
return false;
}
}
}
Download 13.1 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling