Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.        int n  =0;
  5.        int numeros [4][5][3];
  6.        int filas = sizeof(numeros)/sizeof(numeros[0]);
  7.        int columnas = sizeof(numeros[0])/sizeof(numeros[0][0]);
  8.        int planos = sizeof(numeros[0][0])/sizeof(numeros[0][0][0]);
  9.        for(int i = 0; i<filas; ++i){
  10.            for(int j = 0; j<columnas; ++j){
  11.                for(int k = 0; k<planos; ++k){
  12.                    numeros[i][j][k] = n++;
  13.                }
  14.            }
  15.        }
  16.  
  17.        cout<<"plano 0 fila 1 columna 1 = "<<numeros[1][1][0]<<endl;
  18.        cout<<"plano 1 fila 1 columna 1 = "<<numeros[1][1][1]<<endl;
  19.        cout<<"plano 2 fila 1 columna 0 = "<<numeros[1][0][2]<<endl;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement