Guest User

Untitled

a guest
Jun 12th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static void Main(string[] args)
  2.         {
  3.             // ex 32 page 32
  4.             bool flag=false;
  5.             int j = 0; int count = 0;
  6.  
  7.             int[] arr1 = new int[5];
  8.             for (int i = 0; i < arr1.Length; i++)
  9.                 arr1[i] = int.Parse(Console.ReadLine());
  10.             int[] arr2 = new int[5];
  11.             for (j = 0; j < arr1.Length; j++)
  12.                 arr1[j] = int.Parse(Console.ReadLine());
  13.  
  14.  
  15.             for (int i = 0; i < arr1.Length; i++)
  16.             {
  17.                 for (j = 0; j < arr1.Length; j++)
  18.                 {
  19.                     if (arr1[i] != arr2[j])
  20.                         count++;
  21.                 }
  22.             }
  23.  
  24.             int [] arr3=new int [count];
  25.             int k=0;
  26.  
  27.             for (int i=0; i<arr1.Length;i++)
  28.             {
  29.                             for (j = 0; j < arr1.Length; j++)
  30.                             {
  31.                                 if (arr1[i]==arr2[j])
  32.                                     flag=true;
  33.                                    
  34.                             }
  35.                
  36.                 if (flag==false)
  37.                 {
  38.                     arr1[i]=arr3[k];
  39.                     arr2[j]=arr3[k+1];
  40.                 }
  41.  
  42.                 Console.WriteLine("ship for repairment:" + arr3);
  43.            }
Add Comment
Please, Sign In to add comment