Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Reverse-a-string/Draco/reverse-a-string.draco
Normal file
24
Task/Reverse-a-string/Draco/reverse-a-string.draco
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* Reverse string in place */
|
||||
proc nonrec reverse(*char s) void:
|
||||
*char e;
|
||||
char t;
|
||||
e := s;
|
||||
while e* /= '\e' do
|
||||
e := e + 1
|
||||
od;
|
||||
while
|
||||
e := e - 1;
|
||||
s < e
|
||||
do
|
||||
t := e*;
|
||||
e* := s*;
|
||||
s* := t;
|
||||
s := s + 1
|
||||
od
|
||||
corp
|
||||
|
||||
proc nonrec main() void:
|
||||
*char testString = "!dlrow ,olleH";
|
||||
reverse(testString);
|
||||
writeln(testString)
|
||||
corp
|
||||
Loading…
Add table
Add a link
Reference in a new issue