public class MainClass { public static void Main() { string s = Console.ReadLine(); int x = s.Length; { while (x >= 0) ; { Console.Write(s[x - 1]); } x--; } } }
var str = Console.ReadLine(); ConsoleWriteline(str.Lenght>0?str[str.Lenght-1]:"");
public class MainClass { public static void Main() { string s = Console.ReadLine(); char c = ' '; int i = 0; int w = 1; while (i != s.Length) ; { if (s[i] == c && ((s[i - 1] != c) || (i - 1 < 0)) && s[i + 1] != c) { w++; } i++; } Console.WriteLine(w); } }