Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
TAPCON
//fpc 3.0.0 program TAPCON; const fi= 'TAPCON.INP'; fo= 'TAPCON.OUT'; max= 300; var n,k: byte; //========================================================// procedure TOHOP; {xay dung chuong trinh con xu ly to hop} Var a: array[1..max] of byte; b: array[1..max] of byte; i,j: byte; Begin For k:=1 to n do Begin For i:=1 to k do a[i]:= i; {xay dung cau hinh co so} Fillchar(b,sizeof(b),0); Repeat {tu cau hinh co so sinh cau hinh tiep theo den khi dat cau hinh cuoi cung} write('{'); for i:=1 to k-1 do write(a[i],', '); writeln(a[k],'}'); For i:=1 to k do b[a[i]]:=1; For i:=1 to k do write(b[i]); writeln; i:=k; while (i>0) and (a[i]=n-k+i) do Dec(i); if i>0 then begin inc(a[i]); for j:=(i+1) to k do a[j]:=a[j-1]+1; {tang a[i] 1 don vi, tat ca phan tu dung sau ve gia tri duoi} end; Until i=0; End; End; //========================================================// BEGIN assign(input,fi); reset(input); assign(output,fo); rewrite(output); read(n); TAPCON; close(input); close(output); END.
run
|
edit
|
history
|
help
0
Задачи на div-mod
Lab 1: Program 1 Hello World
135
Удвоенное число с одинаковыми цифрами
1101010
Hello, 123
test01
1
Banking
Enkripsi2