Uploaded by uyfygfn8787

1-amali ish

advertisement
O‘ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA
KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI
MUHAMMAD AL-XORAZMIY NOMIDAGI
TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
Dasturlash uslublari
va paradigmalari
1-Amaliy ish.
311-21-guruh talabasi
Bajardi:Abdujabborov Doniyorbek
Toshkent 2023
Topshiriq: Password Generator
Password quyidagilardan iborat bo’lishi shart:
1. Lotin harflari (katta va kichik);
2. Raqamlar;
3. Simvollar
Input: L – parolni uzunligi; N – parollar soni.
Output: L uzunlikdagi N ta parol.
Misol: L=5; N=2 | 2p#6F h7Z$a
P.S. Ixtiyoriy dasturlash tilidan foydalanish mumkin
Javob:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("SON = ");
int N = scanner.nextInt();
int hour, minute;
int n = (N+1)/2;
n = n*10-10;
if(N>=120){
System.out.println("Qabul tugadi,ertaga keling!!!");
return;
}
if(N%2==1){
hour = n/60+8;
minute = n%60;
}else {
hour = n/60+8;
minute = n%60+5;
}
System.out.println(hour+":"+minute); }}
Download