27.json 1.3 KB
Newer Older
每日一练社区's avatar
test  
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
{
   "question_id": 673486,
   "question_title": "逆序输出",
   "question_content": "如:abcd1234,逆序输出:4321dcba",
   "difficulty": "简单",
   "answer_id": 501515,
   "answer_content": "可以这样:\n\n\n\n```\nimport java.lang.*;\nimport java.io.*;\nimport java.util.*;\n \nclass ReverseString\n{\n    public static void main(String[] args)\n    {\n        String input = \"abcd1234\";\n \n        // convert String to character array\n        // by using toCharArray\n        char[] try1 = input.toCharArray();\n \n        for (int i = try1.length-1; i>=0; i--)\n            System.out.print(try1[i]);\n    }\n}\n```\n**如果对您有帮助,请点击采纳答案好吗,谢谢~~**\n",
   "tag_name": "java",
   "java": "import java.lang.*;\nimport java.io.*;\nimport java.util.*;\nclass ReverseString {\n\tpublic static void main(String[] args) {\n\t\tString input = \"abcd1234\";\n\t\tchar[] try1 = input.toCharArray();\n\t\tfor (int i = try1.length - 1; i >= 0; i--)\n\t\t\tSystem.out.print(try1[i]);\n\t}\n}",
   "topic_link": "https://bbs.csdn.net/topics/600470192",
   "status": 1,
   "keywords": "排序",
   "license": "csdn.net",
   "notebook": {
      "java": "https://codechina.csdn.net/csdn/csdn-daily-code/-/jupyter/master/data/notebook/answer/ipynb/java/27.ipynb?type=file"
   },
   "notebook_enable": 1
}