Pada kali ini saya akan memberikan indeks membuat Array dalam c++...
Langsung aja..
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{
int i,j;
int sdr[7][30]={
{0,0,0,1,0,1,0,0,0,0,1,1,1,1,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0},
{0,0,1,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,1,0,0,0},
{0,1,0,1,0,1,0,0,0,0,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,0,1,0,0,0},
{1,1,1,1,0,1,0,0,0,0,1,0,0,0,0,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0},
{0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,1,0,0,0},
{0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,1,0,0,0},
{0,0,0,1,0,1,1,1,1,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0}
};
clrscr();
for(i=0;i<7;i++)
{
for(j=0;j<30;j++)
{
if(sdr[i][j])
putchar('\xDB');
else
putchar(' ');
}
cout<<endl;
}
getch();
}
langsung aja coba gan di turbo c++
dan run...!
dan hasilnya
0 komentar:
Posting Komentar