using System;
using System.Collections.Generic;
class Solution {
/**
* 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
*
* 反转字符串
* @param str string字符串
* @return string字符串
*/
public string solve (string str) {
// write code here
var a=str.ToCharArray();
Array.Reverse(a);
return new string(a);
}
}
C# string类没有直接反转的,借用数组的反转函数即可


京公网安备 11010502036488号