Find words whose first and last three letters are equal: Difference between revisions

Add PL/I
(Add PL/I)
Line 479:
8 words: antiperspirant calendrical einstein hotshot murmur oshkosh tartar testes
</pre>
 
=={{header|PL/I}}==
<lang pli>firstAndLast3Equal: procedure options(main);
declare dict file;
open file(dict) title('unixdict.txt');
on endfile(dict) stop;
declare word char(32) varying, (first3, last3) char(3);
do while('1'b);
get file(dict) list(word);
first3 = substr(word, 1, 3);
last3 = substr(word, length(word)-2, 3);
if length(word) > 5 & first3 = last3 then
put skip list(word);
end;
end firstAndLast3Equal;</lang>
{{out}}
<pre>antiperspirant
calendrical
einstein
hotshot
murmur
oshkosh
tartar
testes</pre>
 
=={{header|Quackery}}==
2,114

edits