Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
BITcustom
//fpc 3.0.0 program BITcustom; const fi= 'BITcustom.INP'; fo= 'BITcustom.OUT'; max= 300; var n: byte; //==========================================================// procedure BITcustom; {xay dung chuong trinh sinh cac xau nhi phan co do dai n} Var a: array[1..max] of byte; i,j: byte; Begin For i:=1 to n do a[i]:=0; {xay dung cau hinh co so} Repeat {tu cau hinh co so sinh cau hinh tiep theo den khi dat cau hinh cuoi cung} j:=0; While (j<=2) and (i<=n) do if a[i]<a[i+1] then inc(j); {check xem có thoa yeu cau khong} If j=2 then for i:=1 to n do write(a[i]); while (i>0) and (a[i] =1) do Dec(i); if i>0 then begin a[i] :=1; for j:=(i+1) to n do a[j]:=0; {gan a[i] =1, tat ca so dung sau ve gia tri 0} end; Until i=0; End; //==========================================================// BEGIN assign(input,fi); reset(input); assign(output,fo); rewrite(output); read(n); BITcustom; close(input); close(output); END.
run
|
edit
|
history
|
help
0
task 3
Find the greatest integers - v1
1
registro de alunos, calculo de média
Задача 2 урок не из учебника
Deskripsi2
temp
practica 1 ejercicio 1
sumar 2 valores
jugando