25 lines
407 B
Plaintext
25 lines
407 B
Plaintext
/* 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
|