zoukankan      html  css  js  c++  java
  • 一道很有意思的面试题目(转)

    面试题如下:完成如下代码,使其输出“Hello 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!");
                           }
               }
    }
    填写IF语句里面的内容???
    收集的答案如下,仅供大家参考学习,欢迎提出新方法
    方法一:
    if (new Func<bool>(() => { Console.Write("Hello"); returnfalse; }).Invoke())
    方法二:
    if ((args =newstring[1]{"Hello"}).Length >0&& args.Any(s=>{Console.Write(s);returnfalse;}))
    方法三:
    if (Console.Write("Hello") isobject)
    方法四:
    if (args.Length !=0?true : ((Func<bool>)delegate { Main(newstring[] { "a" }); returnfalse; }).Invoke())
     
  • 相关阅读:
    Maven
    Mybatis
    WinDbg的安装、配置和功能(转发)
    gRPC —— gRPC 基础: C#(待续)
    gRPC —— 通讯协议
    gRPC —— 安全认证
    gRPC —— 概念
    gRPC —— 概览
    grpc和protocol buffer介绍&实例(转载)
    protocol buffers ——git 源码
  • 原文地址:https://www.cnblogs.com/Yukang1989/p/2290684.html
Copyright © 2011-2022 走看看