fork download
  1.  
  2.  
  3. using System;
  4.  
  5. namespace For39262
  6. {
  7. internal class Program
  8. {
  9. private static void Main(string[] args)
  10. {
  11. Console.WriteLine("Here we go...");
  12.  
  13. int[] A = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
  14. int K = 3;
  15.  
  16. if ((K<1) || (K>A.Length) )
  17. {
  18. Console.WriteLine("error on input data");
  19. Console.Read();
  20. return;
  21. }
  22.  
  23. for(int i=K;i<A.Length; i+=K) Console.WriteLine(A[i]);
  24. Console.Read();
  25. }
  26.  
  27.  
  28.  
  29.  
  30. }
  31. }
  32.  
  33.  
Success #stdin #stdout 0.03s 33896KB
stdin
Standard input is empty
stdout
Here we go...
4
7
10