“Tablica 2d w C#” Kod odpowiedzi

Jak uzyskać dane wejściowe w tablicy 2D w 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]);
        }
    }
}
Yellowed Yacare

Dwuwymiarowa tablica w C

#include<stdio.h>
int main(){
   /* 2D array declaration*/
   int abc[5][4];
   /*Counter variables for the loop*/
   int i, j;
   for(i=0; i<5; i++) {
      for(j=0;j<4;j++) {
         printf("Enter value for abc[%d][%d]:", i, j);
         scanf("%d", &abc[i][j]);
      }
   }
   return 0;
}
Long Ladybird

Odpowiedzi podobne do “Tablica 2d w C#”

Pytania podobne do “Tablica 2d w C#”

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu