Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- namespace _11_Еxc_EqualSum
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> arrInput = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
- bool ifExists = true;
- for (int i = 0; i < arrInput.Count(); i++)
- {
- if (arrInput.Take(i).Sum() == arrInput.Skip(i + 1).Sum())
- {
- Console.WriteLine(i);
- ifExists = false;
- break;
- }
- }
- if (ifExists) Console.WriteLine("no");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement