How to find the elements and 4*4 of each backslash in N-order matrix

Source: Internet
Author: User
Tags printf
#include <stdio.h> void Main () {//00-11-22-33 the first slash is the second 10-21-32 int arr2[4][4] =    
                      {00, 01, 02, 03, 10, 11, 12, 13, 20, 21, 22, 23,    
    30, 31, 32, 33,};    
    int I, J;    
    int sum = 0;    
    int index = 0; for (int i = 0; i < 4; i++) {for (int j = 0; J < 4; J +) {//printf    
            ("Initial i=%d", I);    
            Meet this condition//More Highlights: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/if (j-i = j)    
                {int index = j;    
                printf ("\n\n\n%d\n\n", index);    
                printf ("i=%d,j=%d\n", I, j);    
                    for (int i = 0; i < 4; i++) {for (int j = 0; J < 4; J +)    
             {if (j-i = = index)           {sum = Arr2[i][j];    
                } printf ("%d\n Data when y row", sum);    
                System ("pause");    
            sum = 0;    
                } if (i-j = = i) {int index = i;    
                printf ("\n\n\n%d\n\n", index);    
                printf ("i=%d,j=%d\n", i,j);    
                    for (int i = 0; i < 4; i++) {for (int j = 0; J < 4; J +)    
                            {if (i-j = = index) {    
                        Sum + + arr2[i][j];    
                } printf ("%d\n", sum);    
                System ("pause");    
            sum = 0; }} System ("Pause "); }

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.