static void Main(string[] args)
{
for (double i = 4; i <= 6; i += 0.1)
{
Console.WriteLine(i);
}
Console.ReadLine();
}
输出是:
4
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
5
5.1
5.2
5.3
5.4
5.49999999999999
5.59999999999999
5.69999999999999
5.79999999999999
5.89999999999999
5.99999999999999