这是一个测试,只想表达对辛巴的敬意!
测试显示代码的插件WP-Syntax
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/local/lighthouse/softwares/wordpress/wp-content/plugins/wp-syntax/wp-syntax.php on line 380
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/local/lighthouse/softwares/wordpress/wp-content/plugins/wp-syntax/wp-syntax.php on line 380
1 2 3 4 5 | public class Hello { public static void main(String[] args) { System.out.println("Hello World!"); } } |
18 19 20 21 22 | class Example def example(arg1) return "Hello: " + arg1.to_s end end |
该插件的下载及文档地址:https://wordpress.org/plugins/wp-syntax/
根据文档编写以上Demo
手动输入文本内容编写一个段落时,只有按SHIFT+回车来
换行才不会产生新段落
Turing Coding Challenge
Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /usr/local/lighthouse/softwares/wordpress/wp-content/plugins/wp-syntax/wp-syntax.php on line 380
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | // int[] nums = { 1, 2, 3, 4, 5 }; // 根据数组生成所有可能的子数组 // 此例为12345 1234 123 12 1 2345 234 23 2 345 34 3 45 4 5 static IList<ilist<int>> test3(int[] nums) { IList<ilist<int>> result = new List<ilist<int>>(); for (int i = 0; i < nums.Length; i++) { List<int> list = new List<int>(nums); for (int j = 0; j < i; j++) { list.RemoveAt(0); } for (int k = 0; k < list.Count; k++) { List<int> list2 = new List<int>(list); for (int l = 0; l < k; l++) { if (list2.Count > 0) list2.RemoveAt(list2.Count - 1); } result.Add(list2); } } return result; } // string mes = "{()[]}"; // 判断字符串内的各种括号是否符合规则 static bool test2(string mes) { List<char> list = new List<char>(); foreach (char c in mes) { if (c == '{' || c == '[' || c == '(') { list.Add(c); } else if (c == '}') { if (list.Last() != '{') return false; list.RemoveAt(list.Count - 1); } else if (c == ']') { if (list.Last() != '[') return false; list.RemoveAt(list.Count - 1); } else if (c == ')') { if (list.Last() != '(') return false; list.RemoveAt(list.Count - 1); } } return list.Count == 0; } // string[] mes = { "5", "-2", "4", "C", "D", "9", "+", "+" }; // 根据字符数据做运算 static int test1(string[] mes) { List<int> list = new List<int>(); foreach (string s in mes) { Console.WriteLine(s); if (s == "C") { if (list.Count > 0) list.RemoveAt(list.Count - 1); } else if (s == "D") { if (list.Count > 0) { int a = list.Last(); list.Add(a * 2); } } else if (s == "+") { if (list.Count > 1) { int a = list.Last(); int b = list[list.Count - 2]; list.Add(a + b); } } else { list.Add(int.Parse(s)); } } return list.Sum(); } |