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()
C++
#include <iostream>
#include <ctime>
using namespace std;
void sort(int* arr, int size);
int main()
{
srand(time(0));
int size = 10;//Укажешь SIZE
int* arr = new int[size];
for (int i = 0; i < size; i++)
{
arr[i] = 1 + rand() % 50;
cout << arr[i] << " ";
}
sort(arr, size);
cout << endl << endl;
for (int i = 0; i < size; i++)
{
cout << arr[i] << " ";
}
return 0;
}
void sort(int* arr, int size)
{
int temp = 1;
for (int i = 0; i < size; i++)
{
for (int j = 0; j < size; j++)
{
if (arr[i] < arr[j])
{
temp = arr[j];
arr[j] = arr[i];
arr[i] = temp;
}
}
}
}
Объяснение:
1) 4
2) 8
3) 102
4) 3
5) 6