fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int[] dizi = { 4, 5, -15, 22, -34, 3, 0, 7, 43, 100 };
  8. int x = biggestNegative(dizi);
  9. Console.WriteLine(x);
  10.  
  11.  
  12. }
  13. static int biggestNegative(int[] dizi)
  14. {
  15. int maxNumber = 0;
  16. for (int i = 0; i < dizi.Length; i++) {
  17. if (dizi[i] < 0) {
  18. if (maxNumber == 0 || dizi[i] > maxNumber ) {
  19. maxNumber = dizi[i];
  20. }
  21. }
  22. }
  23. return maxNumber;
  24. }
  25. }
Success #stdin #stdout 0.01s 29664KB
stdin
Standard input is empty
stdout
-15