Script C++ Array Multi Dimensi
array multi dimensi
/*Praktek bahasa c */Screenshoot program
/*STT DUTA BANGSA @2010 */
#include <stdio.h>
#include <conio.h>
void main()
{ int i, j, k;
static int data_huruf[3][8][8] =
{ { { 1, 1, 1, 1, 1, 1, 1, 0 },
{ 1, 1, 0, 0, 0, 0, 1, 0 },
{ 1, 1, 0, 0, 0, 0, 0, 0 },
{ 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 0, 0, 0, 1, 1, 1, 0 },
{ 1, 0, 0, 0, 1, 1, 1, 0 },
{ 1, 1, 1, 1, 1, 1, 1, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0 }
},
{ { 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1, 1 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 }
},
{ { 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1, 1, 1, 1, 1, 1, 1, 1 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 },
{ 0, 0, 0, 1, 1, 0, 0, 0 }
}
};
/* menampilkan Huruf */
for(i=0; i<3; i++)
{ for(j=0; j<8; j++)
{ for(k=0;k<8; k++)
if(data_huruf[i][j][k])
putchar(‘\xDB’);
else
printf(” “);
puts(” “);
}
puts(” “);
}
getch();
}
HALAMAN SELANJUTNYA:
0 Response to "Script C++ Array Multi Dimensi"
Post a Comment