Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class HalfSum
- {
- static void Main()
- {
- int nums = int.Parse(Console.ReadLine());
- int sumLeft = 0;
- int sumRight = 0;
- for (int i = 0; i < nums; i++)
- {
- sumLeft += int.Parse(Console.ReadLine());
- }
- for (int i = nums; i < nums * 2; i++)
- {
- sumRight += int.Parse(Console.ReadLine());
- }
- if (sumLeft == sumRight)
- {
- Console.WriteLine("Yes, sum={0}", sumLeft);
- }
- else
- {
- int diff = Math.Abs(sumLeft - sumRight);
- Console.WriteLine("No, diff={0}", diff);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement