题解HJ106 | #字符逆序#

字符逆序

https://www.nowcoder.com/practice/cc57022cb4194697ac30bcb566aeb47b

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        StringBuilder resultString = new StringBuilder();

        for (int i = 0; i < s.length(); i++) {
            resultString.append(s.charAt(s.length() - i - 1));
        }

        System.out.println(resultString.toString());
    }
}

目前为止最快做出的题了 加油!

全部评论

相关推荐

简历求拷打,海投简历发过去就已读不回了求大佬们指点
程序员牛肉:基本不能了,估计你得放弃秋招,九月份找实习之后明年的春招开始正式找工作
点赞 评论 收藏
分享
06-07 19:59
门头沟学院 C++
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务