VB程式設計,輸入平面上任一點的座標 x,y ,判斷並顯示該點位

2021-08-18 00:13:30 字數 1308 閱讀 5658

1樓:匿名使用者

function which(byval p as pointf) as string

dim tp as string = math.sign(p.x) & "," & math.sign(p.y)

select case tp

case "0,0"

return "原點"

case "0,1", "0,-1"

return "y軸"

case "1,0", "-1,0"

return "x軸"

case "1,1"

return "第一象限"

case "-1,1"

return "第二象限"

case "-1,-1"

return "第三象限"

case "1,-1"

return "第四象限"

end select

end function

2樓:匿名使用者

dim inx as long ,iny as longinx = val(inputbox("請輸入x軸數值"))iny = val(inputbox("請輸入y軸數值"))if inx>0 then

if iny>0 then 'x,y >0 第一象限msgbox "座標(" & inx & "," & iny & ") 在第一象限"

elseif iny<0 then ' x> 0 >y第四象限msgbox "座標(" & inx & "," & iny & ") 在第四象限"

end if

elseif inx<0 then

if iny>0 then 'y>0>x 第二象限msgbox "座標(" & inx & "," & iny & ") 在第二象限"

elseif iny<0 then ' x0 thenmsgbox "座標在x軸上"

end if

end if

if iny=0 then

if inx<>0 then

msgbox "座標在y軸上"

end if

end if

'懶得開vb了

(用c++編寫程式)輸入平面直角座標系中一點的座標(x,y),判斷改點是在那個象限中或那一條座標軸上

3樓:匿名使用者

include "math.h"

class point

};class line

float getdistance(point p)};void main()

vb程式設計習題,VB程式設計習題

1.x val inputbox input x if x 10 then y abs x if x 20 then y sqr 3 x 1 if x 20 then y 3 x 2debug.print y 2.x val inputbox input x if x 10 then y abs x...

vb程式設計,什麼是VB程式設計?

1設計引數介面2 設計介面上各個控制項屬性3 編寫程式 4除錯和儲存 什麼是vb程式設計?visual basic程式設計是basic程式語言。vb擁有圖形使用者介面 gui 和快速應用程式開發 rad 系統,可以輕易的使用dao rdo ado連線資料庫,或者輕鬆的建立active x控制項,用於...

VB程式設計

private sub command1 click dim i as integer dim a3,a7 as integerfor i 1 to 100 if i mod 3 0 then a3 a3 1 end if if i mod 7 0 then a7 a7 1 end if next ...