Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
3D NO SE XD
#include <stdio.h> #include<stdlib.h> #include <time.h> int main(){ int ***matriz ; int filas = 4 ; int columnas = 4; int nose = 4 ; matriz = (int***)malloc(filas*sizeof(int**)); if (matriz == NULL){ printf("no se ha podido reservar espacio en la memoria "); exit(1); } for (int i = 0 ; i < filas ; i++){ matriz[i] = (int*)malloc(columnas*sizeof(int)); if (matriz == NULL)exit(1); } for (int i = 0 ; i < filas ; i++) for (int j = 0 ; j < columnas ; j++){ matriz[i][j] = (int **)malloc (nose*sizeof(int*)); } srand(time(NULL)); for (int i = 0 ; i < filas ; i++){ for(int j = 0 ; j < columnas ; j++){ for (int k = 0 ; k < nose ; k++){ matriz[i][j][k] = rand()%5; printf("%d",matriz[i][j][k]); } } } }
run
|
edit
|
history
|
help
0
C pattern Rhombus
치카냥3
C_141210_Punteros
Test1
fgets and basic string manipulation
la profe
date diff sample
CdayName
array and its sum
20171103_Digitos