Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _1.FitBoxInBox
- {
- using System;
- public class FitBoxInBox
- {
- public static void Main(string[] args)
- {
- checked
- {
- int width1 = int.Parse(Console.ReadLine());
- int height1 = int.Parse(Console.ReadLine());
- int depth1 = int.Parse(Console.ReadLine());
- int width2 = int.Parse(Console.ReadLine());
- int height2 = int.Parse(Console.ReadLine());
- int depth2 = int.Parse(Console.ReadLine());
- int sumDims1 = width1 + height1 + depth1;
- int sumDims2 = width2 + height2 + depth2;
- if (sumDims2 > sumDims1)
- {
- ComparingFitsOfTwoBoxesAndPrintResults(width1, height1, depth1, width2, height2, depth2);
- }
- else
- {
- ComparingFitsOfTwoBoxesAndPrintResults(width2, height2, depth2, width1, height1, depth1);
- }
- }
- }
- private static void ComparingFitsOfTwoBoxesAndPrintResults(int w1, int h1, int d1, int w2, int h2, int d2)
- {
- checked
- {
- if (w2 > w1 && h2 > h1 && d2 > d1)
- {
- Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, w2, h2, d2);
- }
- if (w2 > w1 && d2 > h1 && h2 > d1)
- {
- Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, w2, d2, h2);
- }
- if (h2 > w1 && w2 > h1 && d2 > d1)
- {
- Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, h2, w2, d2);
- }
- if (h2 > w1 && d2 > h1 && w2 > d1)
- {
- Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, h2, d2, w2);
- }
- if (d2 > w1 && w2 > h1 && h2 > d1)
- {
- Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, w2, h2);
- }
- if (d2 > w1 && h2 > h1 && w2 > d1)
- {
- Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, h2, w2);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement