fork download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. List<int> list1 = new List<int>() {8, 2, 5, 1, 1};
  9. List<int> list2 = new List<int>(){3, 4, 1, 7, 4};
  10.  
  11. for (int i = 0; i < 3; i++) {
  12. list2[i] = list1[i] + list2[i];
  13. list1[i] = list2[i] - list1[i];
  14. list2[i] = list2[i] - list1[i];
  15. }
  16.  
  17. Console.WriteLine("List 1: ");
  18. foreach (var item in list1) {
  19. Console.WriteLine(item);
  20. }
  21.  
  22. Console.WriteLine("List 1: ");
  23. foreach (var item in list2) {
  24. Console.WriteLine(item);
  25. }
  26. }
  27. }
Success #stdin #stdout 0.03s 33848KB
stdin
Standard input is empty
stdout
List 1: 
3
4
1
1
1
List 1: 
8
2
5
7
4