diff --git a/T1/PudovinnikovPavel17IVT2/1.py b/T1/PudovinnikovPavel17IVT2/1.py new file mode 100644 index 0000000..c334cc5 --- /dev/null +++ b/T1/PudovinnikovPavel17IVT2/1.py @@ -0,0 +1,13 @@ +print("Введите диаметр") +r = float(input()) +print("Введите высоту") +h = float(input()) +print("Введите площадь покрски одной банкой") +s = float(input()) +res = 0 +r = r/2 +sp = 2*3.1415926536*r*(2*h + r) +res = sp//s +if (sp%s) != 0: + res = res + 1 +print("Нужно %d банок"%res) diff --git a/T1/PudovinnikovPavel17IVT2/2.py b/T1/PudovinnikovPavel17IVT2/2.py new file mode 100644 index 0000000..ec7b195 --- /dev/null +++ b/T1/PudovinnikovPavel17IVT2/2.py @@ -0,0 +1,17 @@ +l = [] +flag = 0 +print("Введите длину списка") +n = int(input()) +print("Введите элементы списка") +for i in range(n): + l.append(float(input())) +for i in range(n): + for j in range(i+1,n): + if l[i] == l[j]: + flag = 1 +if flag == 1: + print("Элементы не уникальны") +else: + print("Элементы уникальны") +l.clear() + diff --git a/T1/PudovinnikovPavel17IVT2/3.py b/T1/PudovinnikovPavel17IVT2/3.py new file mode 100644 index 0000000..e40f998 --- /dev/null +++ b/T1/PudovinnikovPavel17IVT2/3.py @@ -0,0 +1,18 @@ +l = [] +print("Введите количество списков") +k = int(input()) +for j in range(k): + print("Введите длину списка") + n = int(input()) + print("Введите элементы списка") + for i in range(n): + l.append(float(input())) + max1 = l[1] + for i in range(n): + if max1 0: + j = j + 1 + if j == 1: + res = arr[i] + elif(j == 3)or(j == 6): + res = res * arr[i] + if j == 6: + break +if j < 6: + print("В списке недостаточно положительных чисел") +else: + print("Произведение равно ",res) + + + + + + + + \ No newline at end of file diff --git a/T3/PudovinnikovPavel17IVT2/1.py b/T3/PudovinnikovPavel17IVT2/1.py new file mode 100644 index 0000000..e8cae58 --- /dev/null +++ b/T3/PudovinnikovPavel17IVT2/1.py @@ -0,0 +1,29 @@ +import timeit +import random +st = timeit.default_timer() +arr = [] +n = int(input('Введите количество элементов: ')) +for i in range(n): + arr.append(random.randint(1,1000)) +for i in range(n): + j = 0 + for j in range(n-i-1): + if arr[j] > arr[j+1]: + (arr[j+1],arr[j])=(arr[j],arr[j+1]) +for i in range(n): + print(arr[i]) +et = timeit.default_timer() - st +print("Время выполнения: ", et) +#10 - 2.249273498653679 +#10^2 - 3.29193793695174 +#10^3 - 4.075557217909449 +#10^4 - 25.317011934455365 + + + + + + + + + \ No newline at end of file diff --git a/T3/PudovinnikovPavel17IVT2/cpp.cpp b/T3/PudovinnikovPavel17IVT2/cpp.cpp new file mode 100644 index 0000000..fd9c437 Binary files /dev/null and b/T3/PudovinnikovPavel17IVT2/cpp.cpp differ diff --git a/T4/PudovinnikovPavel17IVT2/1.py b/T4/PudovinnikovPavel17IVT2/1.py new file mode 100644 index 0000000..530267c --- /dev/null +++ b/T4/PudovinnikovPavel17IVT2/1.py @@ -0,0 +1,35 @@ +import timeit +import random +st = timeit.default_timer() +arr = [] +n = int(input('Введите количество элементов: ')) +for i in range(n): + arr.append(random.randint(1,1000)) +b = [[] for i in range(n)] +for i in range(n): + b[arr[i]//100].append(arr[i]) +for i in range(n): + b[i] = sorted(b[i]) +k = 0 +for i in range(n): + for j in range(len(b[i])): + arr[k] = b[i][j] + k = k + 1 +for i in range(n): + print(arr[i]) +et = timeit.default_timer() - st +print("Время выполнения: ", et) +#10 - 1.8481191807131836 +#10^2 - 2.252296994612607 +#10^3 - 5.307969741326815 +#10^4 - 6.067475429379556 +#10^5 - 188.1723503180865 + + + + + + + + + \ No newline at end of file diff --git a/T4/PudovinnikovPavel17IVT2/cpp.cpp b/T4/PudovinnikovPavel17IVT2/cpp.cpp new file mode 100644 index 0000000..154f5ac Binary files /dev/null and b/T4/PudovinnikovPavel17IVT2/cpp.cpp differ diff --git a/T5/PudovinnikovPavel17IVT2/cpp.cpp b/T5/PudovinnikovPavel17IVT2/cpp.cpp new file mode 100644 index 0000000..7088332 Binary files /dev/null and b/T5/PudovinnikovPavel17IVT2/cpp.cpp differ diff --git a/T6/PudovinnikovPavel17IVT2/1.cpp b/T6/PudovinnikovPavel17IVT2/1.cpp new file mode 100644 index 0000000..d56afef Binary files /dev/null and b/T6/PudovinnikovPavel17IVT2/1.cpp differ diff --git a/T6/PudovinnikovPavel17IVT2/2.cpp b/T6/PudovinnikovPavel17IVT2/2.cpp new file mode 100644 index 0000000..880528a Binary files /dev/null and b/T6/PudovinnikovPavel17IVT2/2.cpp differ diff --git a/T6/PudovinnikovPavel17IVT2/3.py b/T6/PudovinnikovPavel17IVT2/3.py new file mode 100644 index 0000000..3ce4bf7 --- /dev/null +++ b/T6/PudovinnikovPavel17IVT2/3.py @@ -0,0 +1,30 @@ +def myisempty(): + global L + res = False + if len(L) == 0: + res = True + return res +def mypush(a): + global L + return (L.append(a)) +def mypop(): + global L + return (L.pop()) +def mysize(): + global L + return(len(L)) +L = ['1','2','3'] +print(myisempty(),"\n") +mypush(8) +print(L,"\n") +print(mypop(),"\n") +print(L,"\n") +print(mysize(),"\n") + + + + + + + + \ No newline at end of file diff --git a/T7/PudovinnikovPavel17IVT2/1.cpp b/T7/PudovinnikovPavel17IVT2/1.cpp new file mode 100644 index 0000000..3d9817f Binary files /dev/null and b/T7/PudovinnikovPavel17IVT2/1.cpp differ