Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. public class DivSeven
  5. {
  6.   static int counter=1;
  7.   static long[] final = null;
  8.  
  9.     public static long[] Seven(long m)
  10.     {
  11.       string number = m.ToString();
  12.       long x = int.Parse(number.Last().ToString());
  13.       long first = (long)(m * Math.Pow(10, -1));
  14.  
  15.       long result = first - (2 * x);
  16.  
  17.       if (result.ToString().Length > 2)
  18.       {
  19.           counter++;
  20.           Seven(result);      
  21.       }
  22.  
  23.       else
  24.           final = new long[] { result, counter };
  25.  
  26.       return final;
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement