tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
6
Task/Repeat-a-string/Prolog/repeat-a-string.pro
Normal file
6
Task/Repeat-a-string/Prolog/repeat-a-string.pro
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
%repeat(Str,Num,Res).
|
||||
repeat(Str,1,Str).
|
||||
repeat(Str,Num,Res):-
|
||||
Num1 is Num-1,
|
||||
repeat(Str,Num1,Res1),
|
||||
string_concat(Str, Res1, Res).
|
||||
Loading…
Add table
Add a link
Reference in a new issue