C
cui27
Unregistered / Unconfirmed
GUEST, unregistred user!
using System;
using System.Globalization;
public class CustomFormattingTest1
{
public static void Main()
{
int i=123456;
do
uble d=12345.6789;
Console.WriteLine(i.Format("0",null));
Console.WriteLine(i.Format("Number I=0",null));
Console.WriteLine(d.Format("######.#",null));
Console.WriteLine(d.Format("0##,###.#",null));
Console.WriteLine(d.Format("0.000E+000",null));
Console.WriteLine(d.Format("0.000E-000",null));
do
uble d1=1.234;
do
uble d2=0.1234;
Console.WriteLine(d1.Format("000.0%",null));
Console.WriteLine(d2.Format("000.0%",null));
Console.WriteLine(i.Format("Number I /n=/t0",null));
}
}
命令提示符下报错:
FormatTest1.cs(9,23): error CS0117: “int”并不包含对“Format”的定义
FormatTest1.cs(10,23): error CS0117: “int”并不包含对“Format”的定义
FormatTest1.cs(11,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(12,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(13,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(14,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(17,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(18,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(19,23): error CS0117: “int”并不包含对“Format”的定义
using System.Globalization;
public class CustomFormattingTest1
{
public static void Main()
{
int i=123456;
do
uble d=12345.6789;
Console.WriteLine(i.Format("0",null));
Console.WriteLine(i.Format("Number I=0",null));
Console.WriteLine(d.Format("######.#",null));
Console.WriteLine(d.Format("0##,###.#",null));
Console.WriteLine(d.Format("0.000E+000",null));
Console.WriteLine(d.Format("0.000E-000",null));
do
uble d1=1.234;
do
uble d2=0.1234;
Console.WriteLine(d1.Format("000.0%",null));
Console.WriteLine(d2.Format("000.0%",null));
Console.WriteLine(i.Format("Number I /n=/t0",null));
}
}
命令提示符下报错:
FormatTest1.cs(9,23): error CS0117: “int”并不包含对“Format”的定义
FormatTest1.cs(10,23): error CS0117: “int”并不包含对“Format”的定义
FormatTest1.cs(11,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(12,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(13,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(14,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(17,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(18,23): error CS0117: “double”并不包含对“Format”的定
FormatTest1.cs(19,23): error CS0117: “int”并不包含对“Format”的定义