System out println("3-masala"); Scanner sc=new Scanner(System in)


Download 3.83 Kb.
Sana09.05.2023
Hajmi3.83 Kb.
#1449580
Bog'liq
Habiba MI 303

System.out.println("3-masala");


Scanner sc=new Scanner(System.in);
System.out.println("Soatni kiriting");
int soat=sc.nextInt();
System.out.println("Minutni kiriting");
int min=sc.nextInt();
System.out.println("Sekundni kiriting");
int sec=sc.nextInt();
if(sec >= 55){
System.out.println(soat+":"+(min+1)+":"+((sec+5)%60));
}else{
System.out.println(soat+":"+min+":"+(sec+5));
}

1-masala.


public class Main {
public static void main(String[] args) {
// Tasodifiy sonni hisoblash
int tasodifiy = (int) (Math.random() * (35 - 1 + 1) + 1);
// Natijani ekranga chiqaramiz
System.out.println("1 va 35 orasidan tasodifiy son: " + tasodifiy);
}
}
Download 3.83 Kb.

Do'stlaringiz bilan baham:




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