Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - using System;
 - namespace Odd_and_Even_Product
 - {
 - class Program
 - {
 - static void Main(string[] args)
 - {
 - int n = int.Parse(Console.ReadLine());
 - int oddSum = 1;
 - int evenSum = 1;
 - for (int i = 1; i <= n; i++)
 - {
 - int num = int.Parse(Console.ReadLine());
 - if (i % 2 != 0)
 - {
 - oddSum *= num;
 - }
 - else
 - {
 - evenSum *= num;
 - }
 - }
 - if (oddSum == evenSum)
 - {
 - Console.WriteLine($"yes {oddSum}");
 - }
 - else
 - {
 - Console.WriteLine($"no {oddSum} {evenSum}");
 - }
 - }
 - }
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment