RosettaCodeData/Task/Longest-string-challenge/FreeBASIC/longest-string-challenge.basic

17 lines
391 B
Plaintext

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