日期:2014-05-20 浏览次数:21268 次
if() printf("Hello");
else printf(" World!");
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
if (/* 补充这里 */)
Console.Write("Hello");
else
Console.Write(" World!");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
if (Convet.ToBool(Console.Write("Hello")))
Console.Write("Hello");
else
Console.Write(" World!");
}
}
}
------解决方案--------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
if (new Func<bool>(() => { Console.Write("Hello"); return false; }).Invoke())
Console.Write("Hello");
else
Console.Write(" World!");
}
}
}
------解决方案--------------------