C návrat 2d pole

Příklady kódu

0
0

jak získat vstup do 2d pole v c

#include <stdio.h>

int main(){

    printf("Enter the number of columns");
    int i; 
    scanf("%d", &i);
    printf("Enter the number of rows");
    int y; 
    scanf("%d", &y);

    int r[i][y];
    int a;
    int b;

        for (a=0; a<i; a++){
            for (b=0; b<y; b++){
    scanf("%d",&r[a][b]);
        }
    }
}
0
0

tisk 2d pole v c

// most of the time I forget that there should be matrix[i][j], not matrix[i]
#include <stdio.h>
// Abdullah Miraz
int main(){
    int i, j;

    int matrix[2][3] = {{2,3,4,5}, {7,8,9,1}};
    for(i=0;i< 2 ; i++){
        for(j=0;j<3;j++){
            printf("%d ", matrix[i][j]);
        }
    }
}

V jiných jazycích

Tato stránka je v jiných jazycích

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................