题解 | 单组_二维字符数组

单组_二维字符数组

https://www.nowcoder.com/practice/2316c1fedff14a8d91694a26c9da3310

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc  = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        sc.nextLine();

        char a[][] = new char[n][m];
        for(int i = 0;i < n;i++){
            String line  = sc.nextLine();
            for(int j = 0;j < m;j++){
                a[i][j] = line.charAt(j);
            }
        }
        for(int i = n - 1;i>=0;i--){
            for(int j = m - 1;j >= 0;j--){
                System.out.print(a[i][j]);
            }
            System.out.println();
                }
                sc.close();
    }
}

全部评论

相关推荐

07-02 13:52
门头沟学院 Java
点赞 评论 收藏
分享
醉蟀:你不干有的是人干
点赞 评论 收藏
分享
05-20 21:57
已编辑
门头沟学院 Java
喜欢吃卤蛋的悲伤蛙在...:建信融通没消息吧,我2说有实习挂简历不理了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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