fork download
  1. using System;
  2.  
  3. class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7. int[] firstArray = new int[] { 1, 2, 3 };
  8. int[] secondArray = new int[] { 4, 5, 6 };
  9. int[] resultArray;
  10.  
  11. SortArray(firstArray);
  12. SortArray(secondArray);
  13. resultArray = MultiplyArrays(firstArray, secondArray);
  14. for (int i = 0; i < resultArray.Length; i++)
  15. Console.WriteLine(resultArray[i]);
  16. Console.ReadLine();
  17.  
  18. }
  19.  
  20. private static void SortArray(int[] array)
  21. {
  22. int temp = new int();
  23. for (int i = 0; i < array.Length; i++)
  24. {
  25. for (int j = i + 1; j < array.Length; j++)
  26. {
  27. if (array[i] < array[j])
  28. {
  29. temp = array[j];
  30. array[j] = array[i];
  31. array[i] = temp;
  32. }
  33. }
  34. }
  35. }
  36.  
  37.  
  38. private static int[] MultiplyArrays(int[] a, int[] b)
  39. {
  40. int[] tempArray = new int[3];
  41. for (int i = 0; i < a.Length; i++)
  42. {
  43. tempArray[i] = a[i] * b[i];
  44. }
  45. return tempArray;
  46. }
  47. }
Success #stdin #stdout 0.01s 131648KB
stdin
Standard input is empty
stdout
18
10
4