本帖最后由 sanmoking 于 2009-12-24 10:15 编辑
貌似我的方法一出来全场震惊,哈哈
看我的:$a = "使用纯AU3编写,禁止调用其他语言(如VBS、JAVA等)。加分:视思路加分,10-60分不等。"
$txt = $a&"sanmoking"
$ok = StringInStr ($txt,"sanmoking")-1
MsgBox(0,"字符数",$ok)
快给我最高分....哈哈
回复 sanmoking
$a = "sanmoking使用纯AU3编写,禁止调用其他语言(如VBS、JAVA等)。加分:视思 ...
afan 发表于 2009-12-23 15:44
哈哈,,$a = "sanmoking纯AU3编写,禁止调用其他sanmoking1001语言"&@CR&@CRLF&"加分10-60分不等。"
$b = "sanmoking"
While 1
if StringInStr ($a,$b) > 0 Then
$b = $b&Random(0,9,1)
Else
ExitLoop
EndIf
WEnd
$txt = $a&$b
$ok = StringInStr ($txt,$b)-1
MsgBox(0,"结果",StringLen ($a)&@CRLF&$ok)
刚看见题目上不让用if,那就不用啦,如下:$a = InputBox("计算输入的字符数量","请随便输入一段文字:","这里随便写点文字。"," M",150,50)
$b = "看这下谁再说我的关键词会有重复,我写个长长长长的关键词,你要是专门一个一个打出来,那我真的佩服你拉,哈哈."
Do
$b = $b&Random(0,9,1)
Until StringInStr ($a,$b) = 0
$txt = $a&$b
$ok = StringInStr ($txt,$b)-1
MsgBox(0,"结果","<"&$a&">"&@CRLF&"-------------------------------"&@CRLF&"StringLen的结果: "&StringLen ($a)&@CRLF&"我的结果: "&$ok)
|