vbs难题{急急急!!}在线等啊
发布网友
发布时间:2023-10-13 14:16
我来回答
共2个回答
热心网友
时间:2023-12-02 21:00
1.
num=12345
Do while num>=2
temp=temp&cstr(num Mod 2)
num=Int(num/2)
Loop
msgbox "12345="&temp
#####################################################
2.
for i = 1234 to 98765
mark=0
str=cstr(i)
for j = 1 to len(str)-1
for k = j+1 to len(str)
if mid(str,j,1)=mid(str,k,1) then
mark=mark+1
end if
next
next
if mark = 0 then
if (i mod 2)=0 then
odd=odd+1
else
even=even+1
end if
end if
next
msgbox "奇数有:"&odd&"偶数有:"&even
#######################################################
3.
for i = 1 to 100
if ((i*1000000+666666) mod 199) = 0 then
msgbox "这个自然数最小是:"&(i*1000000+666666)/199
exit for
end if
next
#######################################################
4.
Randomize
num1=int(100*Rnd)
num2=int(10*Rnd)
equ=num1&"*"&num2
ans = inputbox(equ & "=?")
if int(ans) = eval(equ) then
msgbox "Right!"
else
if eval(equ)<99 then
Msgbox "计算如下:"&chr(13)&num1&chr(13)&"* "&num2&chr(13)&"-----"&chr(13)&eval(equ),vbMsgBoxRight,"prompt "
else
num3=int(num1/10)
num4=num1-num3*10
Msgbox "计算如下:"&chr(13)&num1&chr(13)&"* "&num2&chr(13)&"------"&chr(13)&num4*num2&chr(13)&"+ "&num3*num2&" "&chr(13)&"------"&chr(13)&eval(equ),vbMsgBoxRight,"prompt "
end if
end if
热心网友
时间:2023-12-02 21:01
1.
x=12345
m=x
Do while x>=2
m=x Mod 2
x=Int(x/2)
WScript.echo x&" "&m
Loop
Microsoft (R) Windows Script Host Version 5.7
版权所有(C) Microsoft Corporation 1996-2001。保留所有权利。
6172 1
3086 0
1543 0
771 1
385 1
192 1
96 0
48 0
24 0
12 0
6 0
3 0
1 1
***** script completed *****
结果:11000000111001
热心网友
时间:2023-12-02 21:00
1.
num=12345
Do while num>=2
temp=temp&cstr(num Mod 2)
num=Int(num/2)
Loop
msgbox "12345="&temp
#####################################################
2.
for i = 1234 to 98765
mark=0
str=cstr(i)
for j = 1 to len(str)-1
for k = j+1 to len(str)
if mid(str,j,1)=mid(str,k,1) then
mark=mark+1
end if
next
next
if mark = 0 then
if (i mod 2)=0 then
odd=odd+1
else
even=even+1
end if
end if
next
msgbox "奇数有:"&odd&"偶数有:"&even
#######################################################
3.
for i = 1 to 100
if ((i*1000000+666666) mod 199) = 0 then
msgbox "这个自然数最小是:"&(i*1000000+666666)/199
exit for
end if
next
#######################################################
4.
Randomize
num1=int(100*Rnd)
num2=int(10*Rnd)
equ=num1&"*"&num2
ans = inputbox(equ & "=?")
if int(ans) = eval(equ) then
msgbox "Right!"
else
if eval(equ)<99 then
Msgbox "计算如下:"&chr(13)&num1&chr(13)&"* "&num2&chr(13)&"-----"&chr(13)&eval(equ),vbMsgBoxRight,"prompt "
else
num3=int(num1/10)
num4=num1-num3*10
Msgbox "计算如下:"&chr(13)&num1&chr(13)&"* "&num2&chr(13)&"------"&chr(13)&num4*num2&chr(13)&"+ "&num3*num2&" "&chr(13)&"------"&chr(13)&eval(equ),vbMsgBoxRight,"prompt "
end if
end if
热心网友
时间:2023-12-02 21:01
1.
x=12345
m=x
Do while x>=2
m=x Mod 2
x=Int(x/2)
WScript.echo x&" "&m
Loop
Microsoft (R) Windows Script Host Version 5.7
版权所有(C) Microsoft Corporation 1996-2001。保留所有权利。
6172 1
3086 0
1543 0
771 1
385 1
192 1
96 0
48 0
24 0
12 0
6 0
3 0
1 1
***** script completed *****
结果:11000000111001
热心网友
时间:2023-12-02 21:00
1.
num=12345
Do while num>=2
temp=temp&cstr(num Mod 2)
num=Int(num/2)
Loop
msgbox "12345="&temp
#####################################################
2.
for i = 1234 to 98765
mark=0
str=cstr(i)
for j = 1 to len(str)-1
for k = j+1 to len(str)
if mid(str,j,1)=mid(str,k,1) then
mark=mark+1
end if
next
next
if mark = 0 then
if (i mod 2)=0 then
odd=odd+1
else
even=even+1
end if
end if
next
msgbox "奇数有:"&odd&"偶数有:"&even
#######################################################
3.
for i = 1 to 100
if ((i*1000000+666666) mod 199) = 0 then
msgbox "这个自然数最小是:"&(i*1000000+666666)/199
exit for
end if
next
#######################################################
4.
Randomize
num1=int(100*Rnd)
num2=int(10*Rnd)
equ=num1&"*"&num2
ans = inputbox(equ & "=?")
if int(ans) = eval(equ) then
msgbox "Right!"
else
if eval(equ)<99 then
Msgbox "计算如下:"&chr(13)&num1&chr(13)&"* "&num2&chr(13)&"-----"&chr(13)&eval(equ),vbMsgBoxRight,"prompt "
else
num3=int(num1/10)
num4=num1-num3*10
Msgbox "计算如下:"&chr(13)&num1&chr(13)&"* "&num2&chr(13)&"------"&chr(13)&num4*num2&chr(13)&"+ "&num3*num2&" "&chr(13)&"------"&chr(13)&eval(equ),vbMsgBoxRight,"prompt "
end if
end if
热心网友
时间:2023-12-02 21:01
1.
x=12345
m=x
Do while x>=2
m=x Mod 2
x=Int(x/2)
WScript.echo x&" "&m
Loop
Microsoft (R) Windows Script Host Version 5.7
版权所有(C) Microsoft Corporation 1996-2001。保留所有权利。
6172 1
3086 0
1543 0
771 1
385 1
192 1
96 0
48 0
24 0
12 0
6 0
3 0
1 1
***** script completed *****
结果:11000000111001