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 ForLessons
- {
- /*
- * persistence(39) == 3 // because 3*9 = 27, 2*7 = 14, 1*4=4
- // and 4 has only one digit
- persistence(999) == 4 // because 9*9*9 = 729, 7*2*9 = 126,
- // 1*2*6 = 12, and finally 1*2 = 2
- persistence(4) == 0 // because 4 is already a one-digit number
- * */
- class Program
- {
- static void Main(string[] args)
- {
- }
- public static int Persistence(long n)
- {
- // your code
- return 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment