我试图让以下代码工作,所以如果
输入是:你好吗?
输出应该是:
eud怎么样?
我认为我非常接近完成它但我无法理解为什么,正则表达式不起作用它不被识别.这是repl:https://repl.it/MHzu/1
using System.Collections.Generic;
using System.Linq;
using System;
using System.Text.RegularExpressions;
public class Kata
{
static void Main(string[] args)
{
string str = Console.ReadLine();
string opaa = str;
Match m = Regex.match(str,"(\w*) (\w.*)");
string hoho = m.Groups[1];
string strrev = "";
foreach (var word in opaa.Split(' '))
{
string temp = " ";
foreach (var ch in word.ToCharArray())
{
temp = ch + temp;
}
strrev = strrev + temp + "";
}
Console.WriteLine(hohoo + …Run Code Online (Sandbox Code Playgroud)