Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Решение 19 задания
- function f(n,s, turn: integer): boolean;
- begin
- if (n+s>=77) and (turn=2) then result:=True else
- if (n+s<77) and (turn=2) then result:=False else
- if (n+s>=77) and (turn<>2) then result:=False else
- result:=f(n,S*2,turn+1) or f(n,S+1,turn+1) or f(n*2,S,turn+1) or f(n+1,S,turn+1);
- end;
- begin
- for var i:=1 to 69 do
- if f(7,i,0) then begin print('19:',i);
- break;
- end;
- end.
Add Comment
Please, Sign In to add comment