Java__ Xiao Meng recently in doing a rollover of the application of the picture, you may also know that the picture is actually made up of a point. So, Xiao Meng wanted to do a program that can flip the matrix to solve the core of his problem.

Source: Internet
Author: User
Import Java.util.Scanner;
		public class Main {public static void main (string[] args) {Scanner in=new Scanner (system.in);
        int N=in.nextint ();
        int M=in.nextint ();
        int T=in.nextint ();
        int [][]arr=new int[n][m];
        int [][]arr2=new int[n][m];
            for (int i=0;i<n;i++) {for (int j=0;j<m;j++) {arr[i][j]=in.nextint (); } if (T==1) {for (int i=0;i<n;i++) {for (int j=0;j<m;j++) {AR
            R2[N-1-I][J]=ARR[I][J]; } for (int i=0;i<n;i++) {for (int j=0;j<m;j++) {SYSTEM.OUT.P
                Rint (arr2[i][j]+ "");
            } System.out.println (); } if (t==0) {for (int i=0;i<n;i++) {for (int j=0;j<m;j++) {AR
            R2[I][M-1-J]=ARR[I][J]; for (int i=0;i<n;i++) {for (int J=0;j<m;j++) {System.out.print (arr2[i][j]+ "");
            } System.out.println (); }
        }
    }
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.