nucLeaRsc2

C# Laborator 8 Problema 2

Nov 16th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication7
  8. {
  9.     class Utils
  10.     {
  11.         public static void Reverse(ref string initialString)
  12.         {
  13.             string reverseString="";
  14.             int i,j=0;
  15.             for(i=initialString.Length-1;i>=0;i--)
  16.             {
  17.                 reverseString = reverseString+initialString[i];
  18.                 j++;
  19.             }
  20.             initialString=reverseString;
  21.         }
  22.  
  23.     }
  24.     class Program
  25.     {
  26.         static void Main(string[] args)
  27.         {
  28.             string x;
  29.             x=Console.ReadLine();
  30.             Utils.Reverse(ref x);
  31.             Console.WriteLine("{0}",x);
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment