fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. var str = new String('5', 62);
  8. Console.WriteLine(str);
  9.  
  10. while(str.Contains("555") || str.Contains("333")) {
  11. if (str.Contains("555")) {
  12. str = Replace(str, "555", "3");
  13. } else {
  14. str = Replace(str, "333", "5");
  15. }
  16. Console.WriteLine(str);
  17. }
  18.  
  19. Console.WriteLine();
  20. Console.WriteLine();
  21. Console.WriteLine(str);
  22. }
  23.  
  24. static String Replace(String s, String p, String d) {
  25. int place = s.IndexOf(p);
  26. return s.Remove(place, p.Length).Insert(place, d);
  27. }
  28. }
Success #stdin #stdout 0.03s 17152KB
stdin
Standard input is empty
stdout
55555555555555555555555555555555555555555555555555555555555555
355555555555555555555555555555555555555555555555555555555555
3355555555555555555555555555555555555555555555555555555555
33355555555555555555555555555555555555555555555555555555
333355555555555555555555555555555555555555555555555555
3333355555555555555555555555555555555555555555555555
33333355555555555555555555555555555555555555555555
333333355555555555555555555555555555555555555555
3333333355555555555555555555555555555555555555
33333333355555555555555555555555555555555555
333333333355555555555555555555555555555555
3333333333355555555555555555555555555555
33333333333355555555555555555555555555
333333333333355555555555555555555555
3333333333333355555555555555555555
33333333333333355555555555555555
333333333333333355555555555555
3333333333333333355555555555
33333333333333333355555555
333333333333333333355555
3333333333333333333355
53333333333333333355
553333333333333355
5553333333333355
33333333333355
533333333355
5533333355
55533355
333355
5355


5355