using System;
using System.Linq;
namespace project {
class Program {
public static void Main() {
Console.WriteLine(Reverse("This is an example!"));
}
public static string Reverse(string text) {
string[] arr = text.Split();
for(int i = 0; i != arr.Length; i++) {
char[] array = arr[i].ToCharArray();
Array.Reverse(array);
arr[i] = new String(array);
string result = string.Join(" ", arr);
return result;
}
}
}
public static string Reverse(string text) {
string[] arr = text.Split();
for(int i = 0; i != arr.Length; i++) {
char[] array = arr[i].ToCharArray();
Array.Reverse(array);
arr[i] = new String(array);
} // Забыл вот эту фигурную скобку
string result = string.Join(" ", arr);
return result;
}
using System;
namespace project
{
class Program
{
public static void Main()
{
Console.WriteLine(Reverse("This is an example!"));
}
public static string Reverse(string text)
{
var arr = text.Split();
for (var i = 0; i != arr.Length; i++)
{
var array = arr[i].ToCharArray();
Array.Reverse(array);
arr[i] = new String(array);
var result = string.Join(" ", arr);
return result;
}
throw new ArgumentException("String must have size > 0");
}
}
}