Advertisement
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 Left_and_Right_Sum
- {
- class Left_and_Right_Sum
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int SumOne = 0;
- int SumTwo = 0;
- for (int i = 1; i <= n; i++)
- {
- int First = int.Parse(Console.ReadLine());
- SumOne += First;
- }
- for (int j = 1; j <= n; j++)
- {
- int Two = int.Parse(Console.ReadLine());
- SumTwo += Two;
- }
- int difference = Math.Abs(SumOne - SumTwo);
- if (difference == 0) Console.WriteLine("Yes sum " + SumOne);
- else Console.WriteLine("No diff " + difference);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement