#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int n;
cout << "Введи количество чисел: "; cin >> n;
int a, b;
cout << "Введи левую границу (a): "; cin >> a;
cout << "Введи правую границу (b): "; cin >> b;
int *p = new int[n];
for (int i = 0; i < n; i++)
cin >> p[i];
if (p[i] <= b && p[i] >= a)
cout << " " << p[i];
}
delete[] p;
return 0;
import tkinter as tk
class Form(tk.Frame):
def __init__(self, root):
super().__init__(root)
self.master = root
self.master.title('Window #1')
self.master.resizable(False, False)
self.master.geometry('500x600')
self.build()
def build(self):
frame = tk.Frame(self, width = 500, height = 600, bg = 'green')
frame.pack()
def main():
root = tk.Tk()
form = Form(root)
form.pack()
root.mainloop()
if __name__ == '__main__':
main()
Объяснение:
#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int n;
cout << "Введи количество чисел: "; cin >> n;
int a, b;
cout << "Введи левую границу (a): "; cin >> a;
cout << "Введи правую границу (b): "; cin >> b;
int *p = new int[n];
for (int i = 0; i < n; i++)
cin >> p[i];
for (int i = 0; i < n; i++)
{
if (p[i] <= b && p[i] >= a)
cout << " " << p[i];
}
delete[] p;
return 0;
}
import tkinter as tk
class Form(tk.Frame):
def __init__(self, root):
super().__init__(root)
self.master = root
self.master.title('Window #1')
self.master.resizable(False, False)
self.master.geometry('500x600')
self.build()
def build(self):
frame = tk.Frame(self, width = 500, height = 600, bg = 'green')
frame.pack()
def main():
root = tk.Tk()
form = Form(root)
form.pack()
root.mainloop()
if __name__ == '__main__':
main()
Объяснение: