Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Увеличение двоичного числа на 1
//fpc 3.0.0 program HelloWorld; var a : array [1..5] of integer; var i, k, d : integer; begin d := 0; for k := 1 to 31 do begin a[5] := a[5] + 1 + d; if a[5] > 1 then begin a[5] := 0; d := 1 end; for i := 4 downto 1 do begin a[i] := a[i] + d; if a[i] > 1 then begin a[i] := 0; d := 1 end else d := 0; end; writeln (a[1], a[2], a[3], a[4], a[5]) end; end.
run
|
edit
|
history
|
help
0
practica 11 ejercicio 2
matrica
AR sredine
AgentMaxence
test20
2
1
Lab1SumWithWhile
Opdracht_1
Triangle.pas