...
This commit is contained in:
parent
051504d65b
commit
0457928c3e
295 changed files with 3588 additions and 3 deletions
16
Task/Ordered-words/MATLAB/ordered-words.m
Normal file
16
Task/Ordered-words/MATLAB/ordered-words.m
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
maxlen = 0;
|
||||
listlen= 0;
|
||||
fid = fopen('unixdict.txt','r');
|
||||
while ~feof(fid)
|
||||
str = fgetl(fid);
|
||||
if any(diff(abs(str))<0) continue; end;
|
||||
|
||||
if length(str)>maxlen,
|
||||
list = {str};
|
||||
maxlen = length(str);
|
||||
elseif length(str)==maxlen,
|
||||
list{end+1} = str;
|
||||
end;
|
||||
end
|
||||
fclose(fid);
|
||||
printf('%s\n',list{:});
|
||||
Loading…
Add table
Add a link
Reference in a new issue