tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,18 @@
|
|||
function Squish( s1 )
|
||||
dim sRes
|
||||
sRes = vbNullString
|
||||
dim i, c
|
||||
for i = 1 to len( s1 )
|
||||
c = lcase( mid( s1, i, 1 ))
|
||||
if instr( "abcdefghijklmnopqrstuvwxyz0123456789", c ) then
|
||||
sRes = sRes & c
|
||||
end if
|
||||
next
|
||||
Squish = sRes
|
||||
end function
|
||||
|
||||
function isPalindrome( s1 )
|
||||
dim squished
|
||||
squished = Squish( s1 )
|
||||
isPalindrome = ( squished = StrReverse( squished ) )
|
||||
end function
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
wscript.echo isPalindrome( "My dog has fleas")
|
||||
wscript.echo isPalindrome( "Madam, I'm Adam.")
|
||||
wscript.echo isPalindrome( "1 on 1")
|
||||
wscript.echo isPalindrome( "In girum imus nocte et consumimur igni")
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
0
|
||||
-1
|
||||
0
|
||||
-1
|
||||
Loading…
Add table
Add a link
Reference in a new issue