Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- public static void output(int[] a)
- {
- int i;
- for (i = 0; i < a.Length; i++)
- Console.WriteLine(a[i]);
- }
- public static int numbox(int[,] a)
- {
- int x;
- x = a.GetLength(0) * a.GetLength(1);
- return x;
- }
- public static int[] chiburarr(int[,] a,int numbox)
- {
- int [] b=new int[numbox];
- int i=0,row=0,col=0;
- for (row = 0; row < a.GetLength(0); row++)
- for (col = 0; col < a.GetLength(1); col++)
- {
- b[i] = a[row, col];
- i++;
- }
- return b;
- }
- public static bool difcheck(int[] a)
- {
- bool ok = true;
- int i, j;
- for (i = 0; i < a.Length; i++)
- {
- for (j = i + 1; j < a.Length; j++)
- {
- if (a[i] == a[j])
- ok = false;
- }
- }
- return ok;
- }
- public static void input2(int[,] a)
- {
- int col,row;
- for (row = 0; row < a.GetLength(0); row++)
- {
- for (col = 0; col < a.GetLength(1); col++)
- a[row, col] = int.Parse(Console.ReadLine());
- }
- }
- public static void output2(int[,] a)
- {
- int col, row;
- for (row = 0; row < a.GetLength(0); row++)
- {
- for (col = 0; col < a.GetLength(1); col++)
- {
- Console.Write(a[row, col]);
- }
- Console.WriteLine(" ");
- }
- }
- static void Main(string[] args)
- {
- int[,]a=new int[3,3];
- int[] b = new int[numbox(a)];
- int x;
- input2(a);
- Console.WriteLine(numbox(a));
- b=chiburarr(a,numbox(a));
- Console.WriteLine(b);
- Console.WriteLine(difcheck(b));
- x = int.Parse(Console.ReadLine());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement