[go: up one dir, main page]

Ideone.com requires JavaScript to work.
fork download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. public class Test
  5. {
  6. public void doAList(List<(int tof, int pw)> pig, int n)
  7. {
  8. for (int j = 0; j < n; j++)
  9. pig.Add((tof: j * 2 + 1, pw: j * 3 + 2));
  10. }
  11.  
  12. public static void Main()
  13. {
  14. Test t = new Test();
  15. List<(int tof, int pw)> p = new List<(int tof, int pw)>();
  16.  
  17. t.doAList(p, 3);
  18.  
  19. for (int j = 0; j < p.Count; j++)
  20. Console.WriteLine($"{j} : {p[j].tof}, {p[j].pw}");
  21. }
  22. }
  23.  
Success #stdin #stdout 0.07s 29480KB
stdin
Standard input is empty
stdout
0 : 1, 2
1 : 3, 5
2 : 5, 8