LOVEU
0赞
发表于 2013/8/14 11:09:32
阅读(1338)
闲来无事,自己编写一个小程序,自娱自乐
1 //date: 2013/8/14 2 //designer :pengxiaoen 3 //function : printf the word love 4 5 #include"stdio.h" 6 7 int main () 8 { 9 unsigned int a[57] = {0, 32, 64, 96, 128,129,130,131, //8bit "L"10 6,7,8, 37,41, 69,73, 101,105, 134,135,136, // 12bit "O"11 12,16, 44,48, 76,80, 109,111, 142, //9bit "V"12 19,20,21,22,23, 51, 83,84,85,86,87, 115, 147,148,149,150,151, //17bit "E"13 27,31, 59,63, 91,95, 123,127, 156,157,158 //11bit 'U'14 };15 int b[5][32]= {0}; 16 int i,j,k,s;17 int temp;18 19 for(i=0;i<5;i++)20 for(j=0;j<32;j++)21 {22 s=0;23 for(k=0;k<57;k++)24 {25 temp = i*32+j; 26 if(a[k] == temp) 27 { 28 s=1; //printf("%d\n",temp); 29 break;30 }31 }32 if(s) b[i][j]='*';33 else b[i][j]=32; 34 } 35 36 for(i=0;i<5;i++)37 {38 for(j=0;j<32;j++)39 printf("%c",b[i][j]);40 printf("\n");41 } 42 printf("\n\n\n");43 system ("pause"); 44 }
执行结果,天机不可泄露