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