RosettaCodeData/Task/Abbreviations-automatic/Amazing-Hopper/abbreviations-automatic.hopper
2023-07-01 13:44:08 -04:00

28 lines
726 B
Text

#include <jambo.h>
#define MAX_LINE 150
Main
Break on
days of week = 0, fd=0, length=0, days=0, temp=0
Open in("dias_de_la_semana.txt")( fd )
If ( Not( File error ) )
Loop if (Not (Eof(fd)) )
Using( MAX_LINE ), Split( Readlin(fd) » (days), days of week, " ")
Continue if( Zero( Length( days of week ) » (length) ) )
i=1
Loop
Let( temp := Ucase(Left( i, days of week )))
aSort(temp)
Break if ( Eq(Length(Unique(temp)), length ) )
++i
Back
Printnl( Cpad(" ",3,Str(i))," : ", Utf8(Ansi(days)) )
Back
Close(fd)
Else
Printnl("Error en archivo: ", ~Get str file error)
End If
End