Var ar:array[1..n] of integer; ar2:array[1..n] of integer; i,k:integer;
function prost(a:integer):boolean; var i:integer; b:boolean; begin b:=true; for i:=2 to a div 2 do if a mod i=0 then begin; b:=false; break; end; if a=1 then b:=false; prost:=b; end;
begin; randomize; k:=0; for i:=1 to n do begin; ar[i]:=random(101); write(ar[i]:4); end; writeln; for i:=1 to n do if prost(ar[i]) then begin; inc(k); ar2[k]:=ar[i]; write(ar2[k]:4); end; end.
n=5;
Var
ar:array[1..n] of integer;
ar2:array[1..n] of integer;
i,k:integer;
function prost(a:integer):boolean;
var i:integer;
b:boolean;
begin
b:=true;
for i:=2 to a div 2 do
if a mod i=0 then
begin;
b:=false;
break;
end;
if a=1 then b:=false;
prost:=b;
end;
begin;
randomize;
k:=0;
for i:=1 to n do
begin;
ar[i]:=random(101);
write(ar[i]:4);
end;
writeln;
for i:=1 to n do
if prost(ar[i]) then
begin;
inc(k);
ar2[k]:=ar[i];
write(ar2[k]:4);
end;
end.
from tkinter import *
def click1():
lbl.configure(text="Вы нажали кнопку 1", font=("",20),bg="cyan2")
window["bg"] = "cyan2"
def click2():
lbl.configure(text="Вы нажали кнопку 2", font=("",20),bg="yellow")
window["bg"] = "yellow"
window = Tk()
window.resizable(False,False)
window.title("ПР_14: ФИО")
window.geometry('600x400')
lbl = Label(window, text="", font=("", 50))
btn = Button(window, text="Кнопка 1", command=click1)
btn.grid(column=1, row=0)
lbl.grid(column="5",row="0")
btn = Button(window, text="Кнопка 2", command=click2)
btn.grid(column=3, row=5)
window.mainloop()