C语言点阵输出字母A
发布网友
发布时间:2022-05-07 17:32
我来回答
共5个回答
热心网友
时间:2022-06-30 21:38
#include <stdio.h>
#include <stdlib.h>
void main()
{
int L[8][8] = {
0,0,0,0,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,1,0,0,1,0,0,
0,0,1,1,1,1,0,0,
0,1,0,0,0,0,1,0,
0,1,0,0,0,0,1,0,
1,0,0,0,0,0,0,1};
int i,j;
for (j=0;j<8;j++)
{
for (i=0;i<8;i++) {
if (L[j][i]==1) {printf("*");} else printf(" ");
}
printf("\n");
}
system("pause");
}
---------
font L[8][8]可以自己调整
热心网友
时间:2022-06-30 21:38
TurboC 输出点阵字母A
#include <stdio.h>
#include <stdlib.h>
#include <graphics.h>
void drawA(int x, int y, int Color);
int main()
{
int GraphDriver;
int GraphMode;
int arg = 0;
int a, b;
int step = 5;
GraphDriver = DETECT;
initgraph(&GraphDriver, &GraphMode, "");
drawA(10, 10, 1);
drawA(10, 20, 4);
drawA(10, 30, 12);
getch();
closegraph();
}
void drawA(int x, int y, int Color)
{
int i, j;
static char point[9][6] =
{{0,0,1,1,0,0},{0,1,1,1,1,0},{1,1,0,0,1,1},{1,1,0,0,1,1},{1,1,0,0,1,1},{1,1,1,1,1,1},
{1,1,0,0,1,1},{1,1,0,0,1,1},{1,1,0,0,1,1}};
for (i = 0; i < 9; i++)
for (j = 0; j < 6; j++)
if (point[i][j] == 1)
putpixel(x + j, y + i, Color);
}
热心网友
时间:2022-06-30 21:39
#include <stdio.h>
void main()
{
int L[8][8] = {
0,0,0,0,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,1,0,0,1,0,0,
0,0,1,1,1,1,0,0,
0,1,0,0,0,0,1,0,
0,1,0,0,0,0,1,0,
1,0,0,0,0,0,0,1};
int i,j;
for (j=0;j<8;j++)
{
for (i=0;i<8;i++) {
if (L[j][i]==1) {printf("*");} else printf(" ");
}
printf("\n");
}
}
热心网友
时间:2022-06-30 21:39
#include <stdio.h>
main()
{
int i,j;
for(i=0;i<8;i++)
{
for(j=0;j<8;j++)
printf("A ");
printf("\n");
}
}
符合你的条件吗 你复制我的代码试试看 好像我理解的太简单了
热心网友
时间:2022-06-30 21:40
#include"stdio.h"
void main()
{
int i,j;
for (i=1;i<=8;i++)
{
if(i<=4)
{
for (j=8-i;j>=1;j--)
printf(" ");
printf(".");
for(j=0;j<=i-1;j++)
printf(" ");
if (i!=1)
printf(".\n");
else
printf("\n");
}
if(i>4)
{
for(j=8-i;j>=1;j--)
printf(" ");
printf(".");
if(i=5)
printf("....");
else
{
for(j=0;j<=i-1;j++)
printf(" ");
}
printf(".\n");
}
}
}