fbinnzhivko

01.02 Fit Box inbox

Apr 15th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.43 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. class FitBoxInBox
  4. {
  5.     static void Main(){
  6.        
  7.         List<int> box1 = new List<int>();
  8.         for (int i = 0; i < 3; i++)
  9.         {
  10.             box1.Add(int.Parse(Console.ReadLine()));
  11.         }
  12.         List<int> box2 = new List<int>();
  13.         for (int i = 0; i < 3; i++)
  14.         {
  15.             box2.Add(int.Parse(Console.ReadLine()));
  16.         }
  17.        
  18.         CompareBoxes(box1, box2);
  19.  
  20.         box2.Reverse(1, 2); CompareBoxes(box1, box2);
  21.        
  22.         box2.Reverse(); CompareBoxes(box1, box2);
  23.        
  24.         box2.Reverse(1, 2); CompareBoxes(box1, box2);
  25.  
  26.         box2.Reverse(); CompareBoxes(box1, box2);
  27.        
  28.         box2.Reverse(1, 2); CompareBoxes(box1, box2);
  29.        
  30.         box2.Reverse(); CompareBoxes(box2, box1);
  31.  
  32.         box1.Reverse(1, 2);CompareBoxes(box2, box1);
  33.        
  34.         box1.Reverse();CompareBoxes(box2, box1);
  35.        
  36.         box1.Reverse(1, 2);CompareBoxes(box2, box1);
  37.  
  38.         box1.Reverse();CompareBoxes(box2, box1);
  39.  
  40.         box1.Reverse(1, 2); CompareBoxes(box2, box1);
  41.     }
  42.    
  43.     private static void CompareBoxes(List<int> first, List<int> second)
  44.     {
  45.         if (first[0] < second[0] && first[1] < second[1] && first[2] < second[2])
  46.         {
  47.             Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})",
  48.                 first[0], first[1], first[2], second[0], second[1], second[2]);
  49.         }
  50.     }
  51. }
Add Comment
Please, Sign In to add comment