This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#1 | |
//#include <iostream> | |
//using namespace std; | |
// | |
//int main() { | |
// int number; | |
// int a = 0; | |
// int i = 1; | |
// cin >> number; | |
// while (i <= number) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
№1 | |
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
int main() { | |
int number; | |
cin >> number; | |
if (number > 0) { | |
number += 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Извините что опоздал была проблема с гистом. Задачи не полностью сохранялись поэтому переотправляю | |
№1 | |
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
int main() { | |
double a, b; | |
cin >> a >> b; | |
cout << "Площадь: " << a * b << endl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
№1 | |
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
int main() { | |
double a, b; | |
cin >> a >> b; | |
cout << "Площадь: " << a * b << endl; | |
cout << "Периметр: " << 2 * (a + b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 | |
numbers = [1, 3, 5, 7, 2, 4, 6, 8] | |
max_sum = 10 | |
groups = [] | |
current_group = [] | |
current_sum = 0 | |
for number in numbers: | |
if current_sum + number > max_sum: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# задание1 | |
# i=0 | |
# num=[] | |
# while i<5: | |
# i+=1 | |
# a=[input('введите число')] | |
# num=num+a | |
# print(num) | |
# задание5 | |
# numbers1=[1,2,3,4,5] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 | |
SIZE = 10 | |
for row in range(SIZE): | |
for col in range(SIZE): | |
print("*", end=" ") | |
print() | |
""" | |
#2 | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Задание № 6 | |
number = int(input("Введите число") | |
min_digit = 9 | |
max_digit = 0 | |
count = 0 | |
print("Введите десятизначное число:") | |
while count < 10: | |
digit = input("Введите цифру: ") | |
number += digit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 | |
n = int(input("Введите число n: ")) | |
a = 0 | |
for i in range(n, 0, -1): | |
a += i | |
print(i, end=" ") | |
print(f"\nСумма чисел от 1 до {n} равна {a}.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
№1 | |
start = int(input("Введите начало диапазона: ")) | |
end = int(input("Введите конец диапазона: ")) | |
current = start | |
while current <= end: | |
if current % 7 == 0: | |
print(current) | |
current += 1 | |
№2 |
NewerOlder