AvengersAssemble

P66Ex16

Dec 18th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2.  
  3. namespace App
  4. {
  5.     class Program
  6.     {
  7.         public static bool IsNumFound(int[,] arr, int n)
  8.         {
  9.             for (int i = 0; i < arr.GetLength(0); i++)
  10.             {
  11.                 for (int k = 0; k < arr.GetLength(1); k++)
  12.                     if (arr[i, k] == n)
  13.                         return true;
  14.             }
  15.             return false;
  16.         }
  17.         static void Main()
  18.         {
  19.             int n = 10, a = 0, num = 1;
  20.             int[,] lottory = new int[3, 3];
  21.             for (int i = 0; i < lottory.GetLength(0); i++)
  22.             {
  23.                 for (int k = 0; k < lottory.GetLength(1); k++)
  24.                     lottory[i, k] = int.Parse(Console.ReadLine());
  25.             }
  26.             while (a < lottory.GetLength(1))
  27.             {
  28.                 num++;
  29.                 while (IsNumFound(lottory, num))
  30.                     num++;
  31.                 Console.Write(num + " ");
  32.                 a++;
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment