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