fork download
  1. namespace CSharp_fudamentalsConsoleApp1
  2. {
  3. internal class Program
  4. {
  5. static void Main(string[] args)
  6.  
  7.  
  8. {
  9. #region 1
  10.  
  11.  
  12. //int minnumber;
  13. //int[] array = new int[10];
  14. //for (int i = 0; i < 10; i++)
  15. //{
  16. // array[i] = int.Parse(Console.ReadLine());
  17. //}
  18. //minnumber = array[0];
  19. //for (int i = 0; i < 10; i++)
  20. //{
  21. // if (array[i] < minnumber)
  22. // {
  23. // minnumber = array[i];
  24. // }
  25. //}
  26. //Console.WriteLine("The minimum number is: " + minnumber);
  27.  
  28. #endregion
  29. #region 2
  30. //char[] arr = new char[] { 'a', 'e', 'i', 'o', 'u' };
  31. //char ch = char.Parse(Console.ReadLine());
  32. //bool isVowel = false;
  33. //for (int i = 0; i < 5; i++)
  34. //{
  35. // if (ch == arr[i])
  36. // {
  37. // isVowel = true;
  38. // break;
  39. // }
  40. //}
  41. //if (isVowel)
  42. //{
  43. // Console.WriteLine(" vowel");
  44. //}
  45. //else
  46. //{
  47. // Console.WriteLine(" consonant");
  48. //}
  49. #endregion
  50. #region 3
  51. //int n = int.Parse(Console.ReadLine());
  52. //for (int i = 0; i <= n; i++)
  53. //{
  54. // Console.WriteLine($"{i}*{n} ={i * n}");
  55. //}
  56. #endregion
  57. #region 4
  58. //int num = int.Parse(Console.ReadLine());
  59. //if (num % 3 == 0 && num % 4 == 0)
  60. //{
  61. // Console.WriteLine("yes");
  62. //}
  63. //else
  64. //{
  65. // Console.WriteLine("No");
  66. //}
  67. #endregion
  68. #region 5
  69. //int decimalNumber = Convert.ToInt32(Console.ReadLine());
  70.  
  71. //string binary = ConvertToBinary(decimalNumber);
  72.  
  73. //Console.WriteLine($"Binary representation: {binary}");
  74. #endregion
  75. #region 6
  76. //int size = Convert.ToInt32(Console.ReadLine());
  77.  
  78. //int[] array1 = new int[size];
  79. //int[] array2 = new int[size];
  80.  
  81. //Console.WriteLine("Enter elements of first sorted array:");
  82. //for (int i = 0; i < size; i++)
  83. //{
  84. // array1[i] = Convert.ToInt32(Console.ReadLine());
  85. //}
  86.  
  87. //Console.WriteLine("Enter elements of second sorted array:");
  88. //for (int i = 0; i < size; i++)
  89. //{
  90. // array2[i] = Convert.ToInt32(Console.ReadLine());
  91. //}
  92.  
  93. //int[] mergedArray = MergeSortedArrays(array1, array2, size);
  94.  
  95. //Console.WriteLine("Merged sorted array:");
  96. //foreach (int num in mergedArray)
  97. //{
  98. // Console.Write(num + " ");
  99. //}
  100. #endregion
  101. #region 7
  102. //int size = int.Parse(Console.ReadLine());
  103. //Stack<int> stack = new Stack<int>();
  104. //for (int i = 0; i < size; i++)
  105. //{
  106. // stack.Push(int.Parse(Console.ReadLine()));
  107. //}
  108. //int[] arr=new int[size];
  109. //for (int i = 0; i < size; i++)
  110. //{
  111. // arr[i] = stack.Pop();
  112. //}
  113. //for (int i = 0; i < size; i++)
  114. //{
  115. // Console.WriteLine(arr[i]);
  116. //}
  117.  
  118. #endregion
  119. }
  120. static string ConvertToBinary(int num)
  121. {
  122. if (num == 0)
  123. return "0";
  124.  
  125. string binary = "";
  126. while (num > 0)
  127. {
  128. binary = (num % 2) + binary;
  129. num /= 2;
  130. }
  131. return binary;
  132. }
  133. static int[] MergeSortedArrays(int[] arr1, int[] arr2, int size)
  134. {
  135. int[] merged = new int[size * 2];
  136. int i = 0, j = 0, k = 0;
  137.  
  138. while (i < size && j < size)
  139. {
  140. if (arr1[i] < arr2[j])
  141. merged[k++] = arr1[i++];
  142. else
  143. merged[k++] = arr2[j++];
  144. }
  145.  
  146. while (i < size)
  147. merged[k++] = arr1[i++];
  148.  
  149. while (j < size)
  150. merged[k++] = arr2[j++];
  151.  
  152. return merged;
  153. }
  154. }
  155. }
Success #stdin #stdout 0.04s 21788KB
stdin
Standard input is empty
stdout
Standard output is empty