SHARE
TWEET

Untitled

a guest May 19th, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Hanna
  4. {
  5.     class Startup
  6.     {
  7.         static void Main()
  8.         {
  9.             String input = "12.12.2222";
  10.             int[] x = { 0, 0, 0 };
  11.             int dateWhich = 0;
  12.             string currentNumber = "";
  13.             string numberToCheck = "";
  14.  
  15.             for (int i = 0; i < input.Length; i++)
  16.             {
  17.                 currentNumber = input[i].ToString();
  18.                 if (currentNumber != ".")
  19.                 {
  20.                     numberToCheck = string.Concat(currentNumber, numberToCheck);
  21.                 }
  22.                 else
  23.                 {
  24.                     //Convert.ToInt32 - v Java  e valueOf()
  25.                     x[dateWhich] = Convert.ToInt32(Reverse(numberToCheck));
  26.                     numberToCheck = "";
  27.                     dateWhich++;
  28.                 }
  29.             }
  30.             x[dateWhich] = Convert.ToInt32(Reverse(numberToCheck));
  31.         }
  32.  
  33.         public static string Reverse(string s)
  34.         {
  35.             char[] charArray = s.ToCharArray();
  36.             Array.Reverse(charArray);
  37.             return new string(charArray);
  38.         }
  39.     }
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top