Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Semordnilap/PureBasic/semordnilap.basic
Normal file
24
Task/Semordnilap/PureBasic/semordnilap.basic
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
If OpenConsole("")=0 : End 1 : EndIf
|
||||
If ReadFile(0,"./Data/unixdict.txt")=0 : End 2 : EndIf
|
||||
NewList dict$()
|
||||
|
||||
While Eof(0)=0 : AddElement(dict$()) : dict$()=Trim(ReadString(0)) : Wend : CloseFile(0)
|
||||
|
||||
While FirstElement(dict$())
|
||||
buf$=dict$() : DeleteElement(dict$())
|
||||
If buf$="" : Continue : EndIf
|
||||
xbuf$=ReverseString(buf$)
|
||||
ForEach dict$()
|
||||
If xbuf$=dict$()
|
||||
res$+buf$+" / "+xbuf$+#LF$
|
||||
Break
|
||||
EndIf
|
||||
Next
|
||||
Wend
|
||||
|
||||
PrintN("Semordnilap pairs found: "+Str(CountString(res$,#LF$)))
|
||||
For k=1 To 5
|
||||
If k=1 : PrintN(~"\nFirst 5 pairs: "+StringField(res$,k,#LF$)) : Continue : EndIf
|
||||
PrintN(Space(15)+StringField(res$,k,#LF$))
|
||||
Next
|
||||
Input()
|
||||
Loading…
Add table
Add a link
Reference in a new issue