deadinside1222

Sirius

Sep 12th, 2022
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. namespace ConsoleApp2
  5. {
  6.     class Program
  7.     {
  8.  
  9.         static void Main(string[] args)
  10.         {
  11.             int frst, scnd, perimetr, cnt = 0;
  12.             perimetr = int.Parse(Console.ReadLine());
  13.             for (frst = 1; frst < perimetr / 2; frst++)
  14.             {
  15.                 for (scnd = 1; scnd < perimetr / 2; scnd++)
  16.                 {
  17.                     if (frst * 2 + scnd * 2 == perimetr)
  18.                     {
  19.                         cnt += 1;
  20.                     }
  21.                 }
  22.             }
  23.             Console.WriteLine(cnt);
  24.  
  25.         }
  26.     }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment