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