C#写法。
private int x = 10;
private int y = 20;
private int z = 30;
protected void Page_Load(object sender, EventArgs e)
{
string str= printnumber(ref x,ref y,ref z);
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "alert(str)", true);
}
private string printnumber(ref int x,ref int y ,ref int z)
{
if(x>1){x+=100;}
if(y>10){y=y*100;}
if(z>100){z=z/100;}
return "X=" + x +";y="+y+";z="+z;
}
参考资料:if
本回答被网友采纳