Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
TOHOP
//fpc 3.0.0 program TOHOP; const fi= 'TOHOP.INP'; fo= 'TOHOP.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; i,j: byte; Begin For i:=1 to k do a[i]:= i; {xay dung cau hinh co so} 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],'}'); 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; //========================================================// BEGIN assign(input,fi); reset(input); assign(output,fo); rewrite(output); read(n,k); TOHOP; close(input); close(output); END.
run
|
edit
|
history
|
help
0
Урок 2. Функции:
LETICIA VIEIRA TEIXEIRA 600618795
BITcustom
practica 1 ejercicio 5
a2
record as a procedure argument
05 ariketa
dz_lesson_17
nomer3
Huong11a2@