
х=7690 - условие
var x, L, M: integer;
begin readln(x);
L:=0;
M:=0;
while x > 0 do begin
1) L:= L + 1 = 1;
M:= M + x mod 10 = 0;
x:= x div 10 = 7 69;
2) L:= L + 1 = 2;
M:= M + x mod 10 = 9;
x:= x div 10 = 7 6;
3) L:= L + 1 = 3;
M:= M + x mod 10 = 15;
x:= x div 10 = 7 ;
4) L:= L + 1 = 4;
M:= M + x mod 10 = 22;
x:= x div 10 = 0;
end;
writeln(L);
write(M);
end.
L = 4; M = 22
Объяснение:
1)L:= L + 1 = 0 + 1 = 1;
M:= M + x mod 10 = 0 + 0 (остаток) = 0;
x:= x div 10 = 7690 : 10 = 769 (остаток 0 здесь не пишется);
2)L:= L + 1 = 1 + 1 = 2;
M:= M + x mod 10 = 0 + 9 (остаток) = 9;
x:= x div 10 = 769 : 10 = 76 (остаток 9 здесь не пишется);
3)L:= L + 1 = 2 + 1 = 3;
M:= M + x mod 10 = 9 + 6 (остаток) = 15;
x:= x div 10 = 76 : 10 = 7 (остаток 6 здесь не пишется);
4)L:= L + 1 = 3 + 1 = 4;
M:= M + x mod 10 = 15 + 7 (остаток) = 22;
x:= x div 10 = 7 : 10 = 0 (остаток 7 здесь не пишется);
from tkinter import*
from tkinter import messagebox
def btn_click():
k=ent.get()
if k=="Python310":
messagebox.showinfo(title="Успіх",message="Windows розблоковано\nНажміть ''ОК''")
root.destroy()
else:
messagebox.showwarning(title="Помилка",message="Неправильний пароль!")
def exits():
if ent.get() !="Python310":
messagebox.showwarning(title="Помилка",message="Неправильний пароль!")
root=Tk()
root.title("Windows заблоковано")
root.geometry("400x200")
root["bg"]="black"
root.protocol("WM_DELETE_WINDOW", exits)
Label(root,text="Введіть пароль: ",font="Arial 25",bg="black",fg="red").pack()
ent=Entry(root,text="",font="Arial 25",width=15)
ent.pack()
Button(root,text="Розблокувати",font="Arial 25",bg="black",fg="red",command=btn_click).pack()
root.mainloop()
Объяснение:
Замість Python310 можна поставити інший пароль