主题:output window怎么使用?
我有这样一小段代码:
private void button1_Click(object sender, System.EventArgs e)
{
Console.WriteLine("{0,10} {1,10}", "x", "f(x)");
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 1, f(1));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 2, f(2));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 3, f(3));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 4, f(4));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 5, f(5));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 6, f(6));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 7, f(7));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 8, f(8));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 9, f(9));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 10, f(10));
}
private float f(float x)
{
return (x * x + 3 * x + 1);
}
当我用debug调试时,结果可以一行一行的显示在output window里。但是直接运行的时候,output window里面什么都没有。请问这是正常的还是有什么操作我没做好?
private void button1_Click(object sender, System.EventArgs e)
{
Console.WriteLine("{0,10} {1,10}", "x", "f(x)");
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 1, f(1));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 2, f(2));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 3, f(3));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 4, f(4));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 5, f(5));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 6, f(6));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 7, f(7));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 8, f(8));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 9, f(9));
Console.WriteLine("{0,10:0.00} {1,10:0.00}", 10, f(10));
}
private float f(float x)
{
return (x * x + 3 * x + 1);
}
当我用debug调试时,结果可以一行一行的显示在output window里。但是直接运行的时候,output window里面什么都没有。请问这是正常的还是有什么操作我没做好?