fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5.  
  6. public class Test
  7. {
  8. public static void Main()
  9. {
  10. string[] a = new string[] { "10", "22", "9", "33", "21", "50", "41", "60", "80" };
  11. List<int> res = new List<int>();
  12. int arrLength = a.Length;
  13. int i = 0;
  14. for (i = 0; i < arrLength; i++)
  15. {
  16. if (i < arrLength)
  17. {
  18. if (res.Count != 0)
  19. {
  20. if (Convert.ToInt32(a[i]) > res[res.Count - 1])
  21. {
  22. res.Add(Convert.ToInt32(a[i]));
  23. }
  24. }
  25. else
  26. {
  27. res.Add(Convert.ToInt32(a[i]));
  28. }
  29. }
  30. }
  31.  
  32. int asdf = res.Count;
  33. Console.Write(asdf);
  34. }
  35. }
Success #stdin #stdout 0.03s 33904KB
stdin
Standard input is empty
stdout
6