Find words which contains all the vowels: Difference between revisions

Add CLU
(Add CLU)
Line 516:
25: sulfonamide
</pre>
 
=={{header|CLU}}==
<lang clu>has_all_vowels_once = proc (s: string) returns (bool)
vowels: string := "aeiou"
vowel_counts: array[int] := array[int]$fill(1,string$size(vowels),0)
for c: char in string$chars(s) do
v: int := string$indexc(c, vowels)
if v>0 then
vowel_counts[v] := vowel_counts[v] + 1
if vowel_counts[v] > 1 then return(false) end
end
end
for i: int in array[int]$elements(vowel_counts) do
if i ~= 1 then return(false) end
end
return(true)
end has_all_vowels_once
 
start_up = proc ()
po: stream := stream$primary_output()
fname: file_name := file_name$parse("unixdict.txt")
fstream: stream := stream$open(fname, "read")
while true do
word: string := stream$getl(fstream)
if string$size(word) > 10 cand has_all_vowels_once(word) then
stream$putl(po, word)
end
end except when end_of_file:
stream$close(fstream)
end
end start_up</lang>
{{out}}
<pre>ambidextrous
bimolecular
cauliflower
communicable
communicate
consanguine
consultative
countervail
exclusionary
grandiloquent
importunate
incommutable
incomputable
insupportable
loudspeaking
malnourished
mensuration
oneupmanship
pandemonium
permutation
perturbation
portraiture
praseodymium
stupefaction
sulfonamide</pre>
 
=={{header|COBOL}}==
2,114

edits