KMI - 絶対値を求める
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class AbsoluteValue : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void Button1_Click1(object sender, EventArgs e)
    {
        var a = Int32.Parse(TextBox1.Text);
        TextBox2.Text = String.Format("{0}", (0 <= a) ? a : (-a));
    }
}
						 
0 コメント:
コメントを投稿