fork download
  1. using System;
  2. using System.Text;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string s="*****\n***\n****";
  9. StringBuilder sb = new StringBuilder();
  10. string subj = "asd";
  11. int counter = 0;
  12. for (int i = 0; i < s.Length; i++) {
  13. if (s[i] == '*') {
  14. sb.Append(subj[counter % subj.Length]);
  15. counter++;
  16. continue;
  17. }
  18. sb.Append(s[i]);
  19. }
  20. Console.WriteLine(sb.ToString());
  21. }
  22. }
Success #stdin #stdout 0.02s 15736KB
stdin
Standard input is empty
stdout
asdas
das
dasd