整数倒置

前端之家收集整理的这篇文章主要介绍了整数倒置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
protected void Button1_Click(object sender,EventArgs e)
{
   int n = Convert.ToInt32(TextBox1.Text);
   int b = 0;
   while (n > 0)
   {
      b = b * 10;
      b = b + n % 10;
      n = n / 10;
   }
   Response.Write("得到的结果:" + b);
}
原文链接:https://www.f2er.com/javaschema/287007.html

猜你在找的设计模式相关文章