Advertisement
koksibg

SAP

Nov 30th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. using System;
  2.  
  3. namespace SAP
  4. {
  5.     class SAP
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int a = 0;
  10.             int b = 0;
  11.             int c = 0;
  12.             string str = "";
  13.             for (int i = 1; i < 7; i++)
  14.             {
  15.                 for (int j = 1; j < 7; j++)
  16.                 {
  17.                     for (int k = 1; k < 7; k++)
  18.                     {
  19.                         a = 49 * i + 8 * j;     // decimal notation
  20.                         b = i + 56 * j;        // decimal notation
  21.                         c = 7 * i + 50 * k;   // decimal notation  
  22.                         str = i.ToString() + j.ToString() + k.ToString();
  23.                         if (a - b == c && i > j)
  24.                         {
  25.                             Console.WriteLine("X = {0}", i);
  26.                             Console.WriteLine("Y = {0}", j);
  27.                             Console.WriteLine("Z = {0}", k);
  28.                             Console.WriteLine("XYZ = " + str);
  29.                             Console.WriteLine();
  30.                         }
  31.                     }
  32.                 }
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement