Advertisement
optybg

9gag

Nov 26th, 2016
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _9gag
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             //http://9gag.com/gag/aVDbqxK
  14.             //result: 3,50 4,50 9,50 3,50
  15.  
  16.             decimal a = 0.0m;
  17.             decimal b = 0.0m;
  18.             decimal c = 0.0m;
  19.             decimal d = 0.0m;
  20.  
  21.             for (a = 1.0m; a <= 8.0m; a+=0.1m)
  22.             {
  23.                
  24.                 for (b = 1.0m; b <= 8.0m; b+=0.1m)
  25.                 {
  26.                    
  27.                     for (c = 1.0m; c < 10.0m; c +=0.1m)
  28.                     {
  29.                        
  30.                         for (d = 1.0m; d <=8.0m; d +=0.1m)
  31.                         {
  32.                            // Console.WriteLine($"{a:f2} {b:f2} {c:f2} {d:f2}");
  33.  
  34.                             if ( (a+b) == 8.0m && (a+c) ==13.0m && (b+d) == 8.0m && (c - d) == 6.0m)
  35.                             {
  36.                                     Console.WriteLine($"{a:f2} {b:f2} {c:f2} {d:f2}");
  37.                                     break;
  38.                             }
  39.                          
  40.                         }
  41.                     }
  42.                 }
  43.             }
  44.         }
  45.     }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement