using System;namespace ConsoleApplication2
{
class Class1 { static void Main(string[] args) {
Console.WriteLine("\n the first phnomenon:");
for(int x=-100;x<=100;x+=100)
{
Console.WriteLine("{0:000;-00000;'0'}",x);
}
Console.WriteLine("\nthe second phenomenon:");
for(x=-100;x<=100;x+=100)
{
Console.WriteLine("{0:正数:0;负数:0;零:0}",x);
}
Console.WriteLine("\n the third phenomenon:");
for(x=-100;x<=100;x+=100)
{
Console.WriteLine("{0:father:-0;mother:0;brother:0}",x);
}
                    Console.Read();
}
}
}
我是初学者,瞎改的!你试试!

解决方案 »

  1.   

    我的问题是x从负值开始执行的,为什么第三种情况先输出mother 值呢 ,也应该按负值,零,正值的顺序输出啊 。你每次都是 从负值开始 
    console.writeline("正;负;0;",x)按照这个排一下顺序:)
      

  2.   

    对不起,我上面的结果写错了 father:-100才对
    to web_gus(penny):
    不好意思,我还是有点不明白。x是首先=-100,然后0,然后100的,为什么-100最后输出呢,难道
    x=-100时先不执行console.writeline操作吗
    谢谢你的回复:)
      

  3.   

    Console.WriteLine("{0:000;      -00000;  '0'}",x);
    Console.WriteLine("{0:正数:0;   负数:0;  零:0}",x);
    Console.WriteLine("{0:father:-0;mother:0;brother:0}",x);
    我就看出来第三种方法的“0:father:-0”,0的前面多了一个负号,所以到了第三中方法的时候出现了100,0,100的情况。是这个地方吗?