fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. bool[] doors = new bool[100];
  8.  
  9. bool test = true;
  10. bool temp1 = false;
  11. bool temp2 = true;
  12. bool temp;
  13.  
  14. for (int i = 1; i <= 100; i++) {
  15.  
  16. if (i == 3) {
  17. temp = temp1;
  18. temp1 = temp2;
  19. temp2 = temp;
  20. }
  21.  
  22. if (test == true) {
  23.  
  24. for (int a = 1; a <= 100; a++) {
  25.  
  26. if (a % i == 0) {
  27.  
  28. doors[a - 1] = temp1;
  29. }
  30. else if(a % i != 0)
  31. doors[a - 1] = temp2;
  32. }
  33. }
  34. else if (test == false) {
  35.  
  36. for (int c = 0; c < 100; c++) {
  37.  
  38. doors[c] = true;
  39.  
  40. }
  41. test = true;
  42. }
  43. }
  44. for (int d = 0; d < 100; d++) {
  45. if (doors[d]) Console.WriteLine(d);
  46. }
  47. }
  48. }
Success #stdin #stdout 0.03s 24080KB
stdin
Standard input is empty
stdout
99