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 For_Max_Number
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int firstNsum = 0;
- int secondNsum = 0;
- for (int i = 0; i < 2 * n ; i++)
- {
- if (i < 0)
- {
- firstNsum += n;
- }
- else
- {
- secondNsum += n;
- }
- }
- if (firstNsum == secondNsum)
- {
- Console.WriteLine($"Yes, sum = {firstNsum}");
- }
- else
- {
- Console.WriteLine($"No, diff = {Math.Abs(firstNsum - secondNsum)}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment