tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,32 @@
|
|||
FUNCTION isPalindrome (what AS STRING) AS LONG
|
||||
DIM whatcopy AS STRING, chk AS STRING, tmp AS STRING * 1, L0 AS LONG
|
||||
|
||||
FOR L0 = 1 TO LEN(what)
|
||||
tmp = UCASE$(MID$(what, L0, 1))
|
||||
SELECT CASE tmp
|
||||
CASE "A" TO "Z"
|
||||
whatcopy = whatcopy & tmp
|
||||
chk = tmp & chk
|
||||
CASE "0" TO "9"
|
||||
MSGBOX "Numbers are cheating! (""" & what & """)"
|
||||
FUNCTION = 0
|
||||
EXIT FUNCTION
|
||||
END SELECT
|
||||
NEXT
|
||||
|
||||
FUNCTION = ISTRUE((whatcopy) = chk)
|
||||
END FUNCTION
|
||||
|
||||
|
||||
FUNCTION PBMAIN () AS LONG
|
||||
DATA "My dog has fleas", "Madam, I'm Adam.", "1 on 1", "In girum imus nocte et consumimur igni"
|
||||
DIM L1 AS LONG, w AS STRING
|
||||
FOR L1 = 1 TO DATACOUNT
|
||||
w = READ$(L1)
|
||||
IF ISTRUE(isPalindrome(w)) THEN
|
||||
MSGBOX $DQ & w & """ is a palindrome"
|
||||
ELSE
|
||||
MSGBOX $DQ & w & """ is not a palindrome"
|
||||
END IF
|
||||
NEXT
|
||||
END FUNCTION
|
||||
Loading…
Add table
Add a link
Reference in a new issue