fork(1) download
  1. using System;
  2. using System.Globalization;
  3. using System.Linq;
  4. using System.Collections.Generic;
  5.  
  6. public class Test
  7. {
  8. public static string CommentToUpper(string input)
  9. {
  10. int index = input.IndexOf("/*");
  11. if (index >= 0)
  12. {
  13. int endIndex = input.LastIndexOf("*/");
  14. if (endIndex > index)
  15. return string.Format("{0}/*{1}*/{2}",
  16. input.Substring(0, index),
  17. input.Substring(index + 2, endIndex - index - 2).ToUpper(),
  18. input.Substring(endIndex + 2));
  19. else
  20. return string.Format("{0}/*{1}",
  21. input.Substring(0, index),
  22. input.Substring(index + 2).ToUpper());
  23. }
  24. return input;
  25. }
  26.  
  27. public static void Main()
  28. {
  29. string output = CommentToUpper("> I am /*not working*/ right now.");
  30. Console.WriteLine(output);
  31. }
  32. }
Success #stdin #stdout 0.05s 33960KB
stdin
Standard input is empty
stdout
> I am /*NOT WORKING*/ right now.