fork download
  1.  
  2. using System;
  3. using System.Collections;
  4. namespace CollectionsApplication
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. ArrayList arr = new ArrayList();
  11. arr.Add(1);
  12. arr.Add(10);
  13. arr.Add('A');
  14. arr.Add(1);
  15. int sum = 0;
  16. foreach (int i in arr)
  17. {
  18. Console.WriteLine(i);
  19. sum = sum + i;
  20. if (i > 5)
  21. break;
  22. }
  23. Console.WriteLine(sum);
  24. Console.ReadLine();
  25. }
  26. }
  27. }
Success #stdin #stdout 0.05s 23984KB
stdin
Standard input is empty
stdout
1
10
11