Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Runtime.InteropServices.ComTypes;
- namespace Лява_и_дясна_сума
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int left = 0;
- int right = 0;
- for (int i = 0; i < n; i++)
- {
- left += int.Parse(Console.ReadLine());
- }
- for (int i = 0; i < n; i++)
- {
- right += int.Parse(Console.ReadLine());
- }
- if (left==right)
- {
- Console.WriteLine($"Yes, sum = {left}");
- }
- else
- {
- int diff = Math.Abs(left - right);
- Console.WriteLine($"No, dif = {diff}");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment