Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MyNamespace
- {
- class Program
- {
- static void Main()
- {
- int[] list = { 2, 3, 6, 1, 0, 9, 11 };
- int eded = 7;
- int[] yeniList = yeniEdedler(list, eded);
- for (int i = 0; i < yeniList.Length; i++)
- Console.Write(yeniList[i] + ", ");
- Console.WriteLine();
- }
- static int[] yeniEdedler(int[] list, int eded)
- {
- int length = 0;
- for (int i = 0; i < list.Length; i++)
- if (list[i] > eded) length++;
- int[] arr = new int[length];
- int j = 0;
- for (int i = 0; i < list.Length; i++)
- if (list[i] > eded)
- {
- arr[j++] = list[i];
- }
- return arr;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement