Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- class ConsoleApplication1
- {
- static void Main()
- {
- BigInteger product = 1;
- BigInteger product2 = 1;
- int counter = 0;
- while (true)
- {
- string number = Console.ReadLine();
- if (number == "END")
- {
- if (counter <= 10)
- {
- Console.WriteLine(product);
- }
- else
- {
- Console.WriteLine("{0}\n{1}", product, product2);
- }
- return;
- }
- if (number == "0")
- {
- continue;
- }
- if (counter % 2 != 0)
- foreach (char symbol in number)
- {
- if (counter <= 10)
- {
- if (symbol == '0')
- {
- continue;
- }
- else
- {
- product *= symbol - '0';
- }
- }
- else if (counter > 10)
- {
- if (symbol == '0')
- {
- continue;
- }
- else
- {
- product2 *= symbol - '0';
- }
- }
- }
- counter++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement