Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ReverseString
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- string reverse = "";
- for (int i = input.Length - 1; i >= 0; i--)
- {
- reverse += input[i];
- }
- Console.WriteLine(reverse);
- }
- }
- }
- Решение с LINQ :
- using System;
- using System.Linq;
- namespace ReverseString
- {
- class Program
- {
- static void Main(string[] args)
- {
- string str = Console.ReadLine();
- Console.WriteLine(string.Join("", str.ToCharArray().Reverse()));
- }
- }
- }
- Тарикатско решение:
- using System;
- using System.Linq;
- namespace ReverseString
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine(string.Join("",Console.ReadLine().ToCharArray().Reverse()));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement