// PascalABC.NET 3.1, сборка 1195 от 09.03.2016 begin var a:=Arr('a','b','c','d'); var m:=a.Length-1; for var x1:=0 to m do for var x2:= 0 to m do for var x3:=0 to m do Write(a[x1],a[x2],a[x3],' ') end.
Результат выполнения программы: aaa aab aac aad aba abb abc abd aca acb acc acd ada adb adc add baa bab bac bad bba bbb bbc bbd bca bcb bcc bcd bda bdb bdc bdd caa cab cac cad cba cbb cbc cbd cca ccb ccc ccd cda cdb cdc cdd daa dab dac dad dba dbb dbc dbd dca dcb dcc dcd dda ddb ddc ddd
begin
var a:=Arr('a','b','c','d');
var m:=a.Length-1;
for var x1:=0 to m do
for var x2:= 0 to m do
for var x3:=0 to m do Write(a[x1],a[x2],a[x3],' ')
end.
Результат выполнения программы:
aaa aab aac aad aba abb abc abd aca acb acc acd ada adb adc add baa bab bac bad bba bbb bbc bbd bca bcb bcc bcd bda bdb bdc bdd caa cab cac cad cba cbb cbc cbd cca ccb ccc ccd cda cdb cdc cdd daa dab dac dad dba dbb dbc dbd dca dcb dcc dcd dda ddb ddc ddd