Begin for var i : = 99 downto 9 do writeln(i,' = ',i*i*i+6); end.
Alex-kustov
12.03.2020
## код на ruby 2.2.3p173 def lineuparraysize(num) cur_size = 4 while num > cur_size cur_size = 2 * cur_size + 8 end cur_size = 2 * cur_size + 8 end def getspiralneighbours(num) a = [] a[0] = [0, 0] a[1] = [-1, 1] moves = [[1, 0], [0, -1], [-1, 0], [0, 1]] move_direction = 0 side_size = 2 cur_size = 1 cycle = 1 mode_direction = 0 for i in 2..lineuparraysize(num) new_num = array.new(2) new_num[0] = a.last[0] + moves[move_direction][0] new_num[1] = a.last[1] + moves[move_direction][1] a[i] = new_num # p new_num cur_size += 1 if cur_size == side_size cur_size = 1 move_direction = (move_direction + 1) % 4 side_size += 1 if move_direction % 2 == 0 cycle += 1 if move_direction == 0 end end a.each_with_index do |i,x| p [x, i] if (i[0]-a[num][0]).abs < = 1 and (i[1]-a[num][1]).abs < = 1 end end getspiralneighbours(1090) вывод (числа и условные координаты) [962, [15, 16]] [1089, [15, 17]] [1090, [16, 17]] [1091, [16, 16]] [1224, [15, 18]] [1225, [16, 18]] [1226, [17, 18]] [1227, [17, 17]] [1228, [17, 16]]
info292
12.03.2020
//первая var a,b,c: integer; beginread(a,b,c); if a> 0 then a: =a*a else a: =a*a*a*a; if b> 0 then b: =b*b else b: =b*b*b*b; if c> 0 then c: =c*c else c: =c*c*c*c; write(a,' ',b,' ',c); end. //вторая var a,b,c: integer; beginread(a); if(a< 100)or(a> 999)then write('заданное число не трехзначное! '); if (a> 99) and (a< 1000)thenbeginb: =a*a; while a< > 0 dobeginc: =c + a mod 10; a: =a div 10; end; c: =c*c*c; if c=a then write('квадрат равен кубу суммы цифр')else write('квадрат не равен кубу суммы цифр')end; end. //третья var a: integer; beginread(a); if a=1 then write('январь'); if a=2 then write('февраль'); if a=3 then write('март'); if a=4 then write('апрель'); if a=5 then write('май'); if a=6 then write('июнь'); if a=7 then write('июль'); if a=8 then write('август'); if a=9 then write('сентябрь'); if a=10 then write('октябрь'); if a=11 then write('ноябрь'); if a=12 then write('декабрь'); end.
Ответить на вопрос
Поделитесь своими знаниями, ответьте на вопрос:
Написать на паскале законченную программу , печатающую числа от 99 до 9 и рядом с каждым из них его кубический корень с избытком 6