Advertisement
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;
- using System.Numerics;
- namespace tester
- {
- class Program
- {
- static void Main(string[] args)
- {
- string input = Console.ReadLine();
- BigInteger evenSum = 0;
- BigInteger product = 1;
- int transformation = 0;
- while(transformation<10)
- {
- product = 1;
- while(input.Length>0)
- {
- input = input.Substring(0, input.Length - 1);
- int counter=0;
- for (int i = 0; i < input.Length; i += 2)
- {
- evenSum += input[i] - 48;
- counter++;
- }
- if(counter>0)product *= evenSum;
- evenSum = 0;
- }
- transformation++;
- input = product.ToString();
- if (input.Length == 1)
- break;
- }
- if(transformation<10)Console.WriteLine(transformation);
- Console.WriteLine(product);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement