将输入的string中"yes" 改为 "no"

来源:互联网 发布:mac轻淘客插件 编辑:程序博客网 时间:2024/05/23 19:19
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Csharp
{
    classProgram
    {
       static void Main(string[] args)
       {
           string myString = Console.ReadLine();
           string [] myWords = myString.Split(' ');
           foreach (string word in myWords)
               Console.Write("{0} ", (word == "yes") ? "no" : word);
           Console.WriteLine();
           Console.ReadKey();
       }
    }
}

0 0
原创粉丝点击