Advertisement
Guest User

Special combinations

a guest
Apr 15th, 2018
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;                  
  2. public class Program
  3. {
  4.     public static void Main()
  5.     {
  6.         int stotici = int.Parse(Console.ReadLine());
  7.         int desetici = int.Parse(Console.ReadLine());
  8.         int edinici = int.Parse(Console.ReadLine());
  9.         int number = stotici*100+desetici*10+edinici;
  10.         for (int i = 100; i <= stotici*100+desetici*10+edinici; i++)
  11.         {
  12.             if ((number % 100) % 2 == 0 && (number / 100) % 2 == 0 && number - (number / 100 * 100) - number % 100 >= 2 && number - (number / 100 * 100) - number % 100 <= 7);
  13.                 {
  14.                     Console.WriteLine(i);
  15.                 }
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement