Язык — Java
1.import java.util.Scanner;
public class Znanija {
public static void main(String args[]) {
int amount = 0, i = 1, number;
Scanner input = new Scanner(System.in);
for(; i<=10; i++) {
number = input.nextInt();
if(number%3 == 0) {
amount += 1;
}
}
System.out.println("\nNumber of multiples of 3: " + amount);
}
}
2.import java.util.Scanner;
public class Znanija {
public static void main(String args[]) {
int[] array = new int[10];
Scanner input = new Scanner(System.in);
for(int i = 0; i<array.length; i++) {
array[i] = input.nextInt();
}
//Сортитовка пузырьком
for (int i = 0; i < array.length; i++) {
//Новая индексная переменная j, которая в дальнейшем будет проверять, ни больше ли неё следующая цифра
for (int j = 0; j < array.length - i - 1; j++) {
//Проверка
if (array[j] > array[j + 1]) {
//Обмен значениями между не сортированными элементами
int temp = array[j];
array[j] = array[j + 1];
array[j + 1] = temp;
}
}
}
System.out.println("\nMaximum multiple of 3: ");
for (int i = 0; i < array.length; i++) {
if(array[i]%10 == 3 && array[i]>array[i-1]) {
System.out.print(array[i]);
}
}
}
}
Размер окна(hw) и шаг(step) лестницы, если надо, можно изменить
Python
import tkinter
hw=580
step=20
master = tkinter.Tk()
canvas = tkinter.Canvas(master, bg='white', height=hw, width=hw)
canvas.pack()
points = []
points2 = []
for x in range (0+step, hw, step):
points.append((x,hw - x +step))
points.append((x,hw - x))
points.append((hw,hw - x))
canvas.create_line(points, fill = 'blue', width=2)
points2.append((2*step,hw))
points2.append((hw,2*step))
canvas.create_line(points2, fill = 'blue', width=2)
master.mainloop()
Dim s() As Integer, n As Integer, m As Integer
Dim i As Integer, j As Integer
Dim min As Integer, max As Integer, q As Integer, w As Integer
Cells.Clear
n = InputBox("CTROKI", , 4)
m = InputBox("CTOLBEC", , 5)
Randomize
ReDim s(n, m) As Integer
For i = 1 To n
max = -100: min = 100
For j = 1 To m
s(i, j) = Int(Rnd() * 60 - 10)
Cells(i, j) = s(i, j)
Cells(i + 2 + n, j) = s(i, j)
If min > s(i, j) Then
min = s(i, j)
q = j
End If
If max < s(i, j) Then
max = s(i, j)
w = j
End If
Next j
Cells(i + 2 + n, w) = min
Cells(i + 2 + n, q) = max
Next i
End Sub