Skip to content

Instantly share code, notes, and snippets.

View 23drix's full-sized avatar

Ivan 23drix

View GitHub Profile
@23drix
23drix / Задачки
Created September 28, 2025 17:06
Задачи №2 по C++ ( Амплеев Иван )
#include <iostream>
#include <cmath>
using namespace std;
#define task_1
#ifdef task_1
int main() {
double x, y;
cout << "Введите x - ";
@23drix
23drix / Задачки
Created September 21, 2025 19:34
Задачки по C++ ( Амплеев Иван )
// Амплеев Иван 9/2-РПО-24/2
#include <iostream>
#include <cmath>
using namespace std;
#define task_1
#ifdef task_1
int main() {
@23drix
23drix / Задачи
Created January 12, 2025 19:53
Python
# Задача 1
numbers = [ 1, 3, 5, 7, 2, 4, 6, 8 ]
group = []
current_group = []
current_sum = 0
max_sum = 10
for i in numbers:
if current_sum + i <= max_sum:
current_group.append(i)
@23drix
23drix / Задачки
Created December 23, 2024 19:51
Python
# # Задание №1
# # i = 0
# # num = []
# # while i < 5:
# # i+=1
# # numbers = int(input("Введите ваше число"))
# # num = num + numbers
# # print(f"{num}")
# #
# # # Задание №2
@23drix
23drix / Lesson №10
Created December 20, 2024 08:50
Python
# Задание №1
# i = 0
# num = []
# while i < 5:
# i+=1
# numbers = int(input("Введите ваше число"))
# num = num + numbers
# print(f"{num}")
#
# # Задание №2
# 1 - Пустой квадрат
for row in range(10):
for col in range(10):
if row == 0 or col == 0 or row == 10 - 1 or col == 10 - 1:
print('*', end=" ")
else:
print(end=' ')
print('')
# 2 - Полный квадрат
@23drix
23drix / Lesson №9
Last active November 15, 2024 08:43
Python
Задание №1:
n=0
while True:
b=int(input("Введите число:"))
if b<0:
break
else:
n+=b
print(n)
@23drix
23drix / Задачки
Created November 12, 2024 20:06
Python
Задача №1:
number1 = int(input("Введите начало диапазона: "))
number2 = int(input("Введите конец диапазона: "))
while number2 - number1 >= 1:
number2 = number2 - 1
if number2 % 7 == 0:
print(number2)
Задание №2:
@23drix
23drix / Lesson №8
Last active November 8, 2024 08:57
Python
Задание №1:
number = int(input("Введите любое число: "))
number2 = 1
while True:
result = number * number2
if result > 50:
break
print(f"{number} * {number2} = {result}")
result += 1
Цикл с условиема while - это цикл, который работает до тех пор, пока условие ИСТИНА.
Итерация - это один шаг цикла.
Синтаксис:
while условие:
код_для_повторения_изменения_переменной
break - остановка цикла.
continue - пропуск итерации.