中国人的四舍五入问题~~~
using System;using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication5
{
class Program
{
static double a(double x)
{
if (x - (int)x >= 0.5)
x = (int)x + 1;
else
x = (int)x;
return x;
}
static void Main(string[] args)
{
Console.WriteLine("输入金额");
double x=double.Parse(Console.ReadLine());
Console.WriteLine("{0}",x);
}
}
}
为什么算不出来四舍五入呢?哪有问题呀。。。请指点一下~~