tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
13
Task/Reverse-a-string/ALGOL-68/reverse-a-string-1.alg
Normal file
13
Task/Reverse-a-string/ALGOL-68/reverse-a-string-1.alg
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
PROC reverse = (REF STRING s)VOID:
|
||||
FOR i TO UPB s OVER 2 DO
|
||||
CHAR c = s[i];
|
||||
s[i] := s[UPB s - i + 1];
|
||||
s[UPB s - i + 1] := c
|
||||
OD;
|
||||
|
||||
main:
|
||||
(
|
||||
STRING text := "Was it a cat I saw";
|
||||
reverse(text);
|
||||
print((text, new line))
|
||||
)
|
||||
2
Task/Reverse-a-string/ALGOL-68/reverse-a-string-2.alg
Normal file
2
Task/Reverse-a-string/ALGOL-68/reverse-a-string-2.alg
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
⌽'asdf'
|
||||
fdsa
|
||||
Loading…
Add table
Add a link
Reference in a new issue