åªç§è¯è¨ï¼ï¼c++:#include<iostream.h>
void main()
{
float x; //å®ä¹x 为å精度浮ç¹å
cout<<"please input x:"; //æ示ç¨æ·è¾å
¥x
cin>>x; //è¾å
¥x
if(x>0) //éæ©å¤æ
{cout<<"y="<<x+2<<endl;}
else if (x==0)
{cout<<"y="<<x<<endl;}
else if(x<0)
{cout<<"y="<<x*10<<endl;}
else
{cout<<"not a number !!!"<<endl;}
} vb:Private Sub Form_Activate()
Dim x! ' å®ä¹x为å精度浮ç¹å
x = InputBox("please input a number") â ä»ç¨æ·è¾å
¥x
If x > 0 Then
Print x + 2
ElseIf x = 0 Then
Print x
Else
Print x * 10
End If
End Sub â å 为å®ä¹ä¸ºå精度åè¾å
¥å
¶ä»åæ¯ç¬¦å·çä¼åºé
温馨提示:答案为网友推荐,仅供参考