通過(guò)and判斷
創(chuàng)新互聯(lián)堅(jiān)持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:網(wǎng)站設(shè)計(jì)制作、網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時(shí)代的黔西南州網(wǎng)站設(shè)計(jì)、移動(dòng)媒體設(shè)計(jì)的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!
a: 00000100 a: 00000010
and b: 00000010 and b: 00000110
00000000 00000010
結(jié)果: 假 真
Qbasic代碼(Basic代碼是怎樣的,我忘記了,很少用,你修改一下,應(yīng)該可以再VB。NET運(yùn)行):
a=4 '將二進(jìn)制轉(zhuǎn)換為十進(jìn)制
b=2
c=6
if a and b then
print "a,b有同一個(gè)1"
else
print "a,b無(wú)同一個(gè)1"
end if
if b and c then
print "b,c有同一個(gè)1"
else
print "b,c無(wú)同一個(gè)1"
end if
end '不喜歡end就卻掉吧
給你個(gè)例子
'生成20個(gè)隨機(jī)整數(shù)
Dim MyRandom As New Random
Dim a(19), b() As Integer
For i = 0 To a.GetUpperBound(0)
a(i) = MyRandom.Next(0, 1001)
Next
b = a.Clone '復(fù)制數(shù)組
'排序
System.Array.Sort(b)
System.Array.Reverse(b)
數(shù)組b是結(jié)果
用不到2個(gè)命令按鈕 1個(gè)就夠
在按鈕的過(guò)程中寫(xiě)如下代碼
dim x as long , y as long ,z as long ,j as long ,n as long
dim k as integer
x = val(text1.text)
y = val(text2.text)
z = val(text3.text)
j = val(text4.text)
if x = then k = k+1
if y= then k = k+1
if z= then k = k+1
if j= then k = k+1
' 若輸入的數(shù)有負(fù)數(shù) 則必須先在這里寫(xiě)下 n=-.....()
do
if x 0 and n = x then
text5.text = text5.text " " x
k = k +1
end if
if y 0 and n = then
text5.text = text5.text " " y
k = k +1
end if
if z 0 and n = z then
text5.text = text5.text " " z
k = k +1
end if
if j 0 and n = j then
text5.text = text.text " " j
k = k +1
end if
if k = 4 then exit for
n=n+1
loop
這是VB的代碼。。。。 不知道.net 適用不
例如你有三個(gè)輸入框,為txtOne
,txtTow,txtThree,
Dim
max1
as
double;
max1=
Convert.ToDouble(txtOne.Text)Convert.ToDouble(txtTow.Text)?"txtOne.Text":"txtTow.Text"
max1=
Convert.ToDouble(txtThree.Text)max1?"txtThree.Text“:"max1";
textBox.text=max1;
我使用記事本寫(xiě)的代碼可能不規(guī)范哦,自己修改即可。