fork download
  1. using static System.Console;
  2. using System.Linq;
  3.  
  4. public class Program {
  5. public static void Main() {
  6. int numero = int.Parse(ReadLine());
  7. int[] arr = new int[numero];
  8. for (int i = 0; i < arr.Length; i++) arr[i] = int.Parse(ReadLine());
  9. foreach(var item in arr.Where(x => x % 2 == 0).OrderBy(x => x)) WriteLine(item);
  10. foreach(var item in arr.Where(x => x % 2 != 0).OrderByDescending(x => x)) WriteLine(item);
  11. }
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/499263/101
Success #stdin #stdout 0.04s 17692KB
stdin
10
4
32
34
543
3456
654
567
87
6789
98
stdout
4
32
34
98
654
3456
6789
567
543
87