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

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();
       }
    }
}

posted @ 2014-07-18 21:07  wu_overflow  阅读(210)  评论(0编辑  收藏  举报