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 Ex._6
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int sumLeft = 0;
- int sumRight = 0;
- for (int i = 0; i < 2 * n; i++)
- {
- if (i < n)
- {
- sumLeft += int.Parse(Console.ReadLine());
- }
- else
- {
- sumRight += int.Parse(Console.ReadLine());
- }
- }
- if (sumLeft == sumRight)
- { Console.WriteLine("yes sum " + sumLeft); }
- else
- {
- int diff = Math.Abs(sumRight - sumLeft);
- Console.WriteLine("no diff " + diff);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment