Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
25
Task/Odd-word-problem/PL-I/odd-word-problem.pli
Normal file
25
Task/Odd-word-problem/PL-I/odd-word-problem.pli
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
test: procedure options (main); /* 2 August 2014 */
|
||||
declare (ch, ech) character (1);
|
||||
declare odd file;
|
||||
|
||||
get_word: procedure recursive;
|
||||
declare ch character (1);
|
||||
|
||||
get file (odd) edit (ch) (a(1));
|
||||
if index('abcdefghijklmnopqrstuvwxyz', ch) > 0 then call get_word;
|
||||
if index('abcdefghijklmnopqrstuvwxyz', ch) > 0 then
|
||||
put edit (ch) (a);
|
||||
else ech = ch;
|
||||
end get_word;
|
||||
|
||||
open file (odd) input title ('/ODDWORD.DAT,TYPE(text),recsize(100)');
|
||||
do forever;
|
||||
do until (index('abcdefghijklmnopqrstuvwxyz', ch) = 0 );
|
||||
get file (odd) edit (ch) (a(1)); put edit (ch) (a);
|
||||
end;
|
||||
if ch = '.' then leave;
|
||||
call get_word;
|
||||
put edit (ech) (a);
|
||||
if ech = '.' then leave;
|
||||
end;
|
||||
end test;
|
||||
Loading…
Add table
Add a link
Reference in a new issue