2 回答
TA贡献1856条经验 获得超17个赞
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <math.h>
main()
{int gdriver = DETECT, gmode, errorcode;
int a,b;
float xm[7][4];
initgraph(&gdriver, &gmode, "c:\\tc20\BGI");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
xm[7][4]={{145,132,155,151},{127,155,177,155},
{162,155,127,219},{131,162,172,212},
{183,146,184,201},{203,130,203,223},
{186,210,203,223},
};
printf ( "%s \n", "qing shu ru yi dong de ju li" );
scanf ( "%d","%d",&a,&b);
for (int y=0; y<=10, y++ )
{ for (int i=0; i<4; i++ )
{
for (int j=0; j<7; j++) a[j][i]=+a/10;
i++;
}
for(int i=1; i<4; i++ )
{
for (int j=0; j<7; j++) xm[j][i]=+b/10;
i++;
}
for (int i=0; i<7;i++) line(xm[i][0],xm[i][1],xm[i][2],xm[i][3]);
delay(100);
cleardevice();
}
getch();
closegraph();
return 0;
}
调试顺利通过
TA贡献1801条经验 获得超16个赞
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <math.h>
main()
{
int gdriver = DETECT, gmode, errorcode;
int i,j,a,b,y;
float xm[7][4]={
{145,132,155,151},{127,155,177,155},
{162,155,127,219},{131,162,172,212},
{183,146,184,201},{203,130,203,223},
{186,210,203,223}
};
initgraph(&gdriver, &gmode, "c:\\tc20\BGI");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
printf ( "%s \n", "qing shu ru yi dong de ju li" );
scanf ( "%d%d",&a,&b);
for (y=0; y<=10; y++ )
{
for (i=0; i<4; i++ )
{
for (j=0; j<7; j++) xm[j][i]+=a/10;
i++;
}
for(i=1; i<4; i++ )
{
for (j=0; j<7; j++) xm[j][i]+=b/10;
i++;
}
for (i=0; i<7;i++) line(xm[i][0],xm[i][1],xm[i][2],xm[i][3]);
delay(100000);
cleardevice();
}
getch();
closegraph();
return 0;
}
- 2 回答
- 0 关注
- 210 浏览
添加回答
举报