RosettaCodeData/Task/Longest-string-challenge/FreeBASIC/longest-string-challenge.basic
2023-07-01 13:44:08 -04:00

16 lines
391 B
Text

Dim As String test, test1, test2
Data "a", "bb", "ccc", "ddd", "ee", "f", "ggg", "~" ' la tilde es solo para mantener el código compacto
Do
Read test
If test = "~" Then Exit Do : End If
If Len(test) > Len(test1) Then
test1 = test
test2 = test1 & Chr(10)
Elseif Len(test) = Len(test1) Then
test2 += test & Chr(10)
End If
Loop
Print(test2)
Sleep