Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication7
- {
- class Utils
- {
- public static void Reverse(ref string initialString)
- {
- string reverseString="";
- int i,j=0;
- for(i=initialString.Length-1;i>=0;i--)
- {
- reverseString = reverseString+initialString[i];
- j++;
- }
- initialString=reverseString;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- string x;
- x=Console.ReadLine();
- Utils.Reverse(ref x);
- Console.WriteLine("{0}",x);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment