Data update
This commit is contained in:
parent
61b93a2cd1
commit
5af6d93694
858 changed files with 20572 additions and 2082 deletions
30
Task/ABC-problem/FutureBasic/abc-problem-1.basic
Normal file
30
Task/ABC-problem/FutureBasic/abc-problem-1.basic
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
include "NSLog.incl"
|
||||
|
||||
local fn CanBlocksSpell( w as CFStringRef ) as CFStringRef
|
||||
NSUInteger i, j
|
||||
CFStringRef s = @"", t1, t2 : if fn StringIsEqual( w, @"" ) then exit fn = @"YES" else w = ucase(w)
|
||||
|
||||
mda(0) = {@"BO",@"XK",@"DQ",@"CP",@"NA",@"GT",@"RE",@"TG",@"QD",¬
|
||||
@"FS",@"JW",@"HU",@"VI",@"AN",@"OB",@"ER",@"FS",@"LY",@"PC",@"ZM"}
|
||||
|
||||
for i = 0 to len(w) - 1
|
||||
for j = 0 to mda_count - 1
|
||||
t1 = mid( mda(j), 0, 1 ) : t2 = mid( mda(j), 1, 1 )
|
||||
if ( fn StringIsEqual( mid( w, i, 1 ), t1 ) ) then s = fn StringByAppendingString( s, t1 ) : mda(j) = @" " : break
|
||||
if ( fn StringIsEqual( mid( w, i, 1 ), t2 ) ) then s = fn StringByAppendingString( s, t2 ) : mda(j) = @" " : break
|
||||
next
|
||||
next
|
||||
if fn StringIsEqual( s, w ) then exit fn = @"YES"
|
||||
end fn = @"NO"
|
||||
|
||||
NSUInteger i
|
||||
CFArrayRef words
|
||||
CFStringRef w
|
||||
words = @[@"", @"a",@"Bark",@"BOOK",@"TrEaT",@"COMMON",@"Squad",@"conFUse",@"ABBA",@"aUtO"]
|
||||
for w in words
|
||||
printf @"Can blocks spell %7s : %@", fn StringUTF8String( w ), fn CanBlocksSpell( w )
|
||||
next
|
||||
|
||||
NSLog( @"%@", fn WindowPrintViewString( 1 ) )
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue