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