可以帮忙调试一下下面的程序吗?

帮忙调试一下下面的程序,谢谢!

#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;
}

繁星coding
浏览 133回答 2
2回答

慕慕森

#include <graphics.h>&nbsp;#include <stdlib.h>&nbsp;#include <stdio.h>&nbsp;#include <conio.h>&nbsp;#include <math.h>&nbsp;main()&nbsp;{int gdriver = DETECT, gmode, errorcode;&nbsp;int a,b;&nbsp;float xm[7][4];&nbsp;initgraph(&gdriver, &gmode, "c:\\tc20\BGI");&nbsp;errorcode = graphresult();&nbsp;if (errorcode != grOk)&nbsp;{&nbsp;printf("Graphics error: %s\n", grapherrormsg(errorcode));&nbsp;printf("Press any key to halt:");&nbsp;getch();&nbsp;exit(1);&nbsp;}&nbsp;xm[7][4]={{145,132,155,151},{127,155,177,155},&nbsp;{162,155,127,219},{131,162,172,212},&nbsp;{183,146,184,201},{203,130,203,223},&nbsp;{186,210,203,223},&nbsp;};&nbsp;printf ( "%s \n", "qing shu ru yi dong de ju li" );&nbsp;scanf ( "%d","%d",&a,&b);&nbsp;for (int y=0; y<=10, y++ )&nbsp;{ for (int i=0; i<4; i++ )&nbsp;{&nbsp;for (int j=0; j<7; j++) a[j][i]=+a/10;&nbsp;i++;&nbsp;}&nbsp;for(int i=1; i<4; i++ )&nbsp;{&nbsp;for (int j=0; j<7; j++) xm[j][i]=+b/10;&nbsp;i++;&nbsp;}&nbsp;for (int i=0; i<7;i++) line(xm[i][0],xm[i][1],xm[i][2],xm[i][3]);&nbsp;delay(100);&nbsp;cleardevice();&nbsp;}&nbsp;getch();&nbsp;closegraph();&nbsp;return 0;&nbsp;}调试顺利通过

侃侃尔雅

#include <graphics.h>&nbsp;#include <stdlib.h>&nbsp;#include <stdio.h>&nbsp;#include <conio.h>&nbsp;#include <math.h>&nbsp;main()&nbsp;{&nbsp;int gdriver = DETECT, gmode, errorcode;&nbsp;int i,j,a,b,y;&nbsp;float xm[7][4]={&nbsp;{145,132,155,151},{127,155,177,155},&nbsp;{162,155,127,219},{131,162,172,212},&nbsp;{183,146,184,201},{203,130,203,223},&nbsp;{186,210,203,223}&nbsp;};&nbsp;initgraph(&gdriver, &gmode, "c:\\tc20\BGI");&nbsp;errorcode = graphresult();&nbsp;if (errorcode != grOk)&nbsp;{&nbsp;printf("Graphics error: %s\n", grapherrormsg(errorcode));&nbsp;printf("Press any key to halt:");&nbsp;getch();&nbsp;exit(1);&nbsp;}&nbsp;printf ( "%s \n", "qing shu ru yi dong de ju li" );&nbsp;scanf ( "%d%d",&a,&b);&nbsp;for (y=0; y<=10; y++ )&nbsp;{&nbsp;for (i=0; i<4; i++ )&nbsp;{&nbsp;for (j=0; j<7; j++) xm[j][i]+=a/10;&nbsp;i++;&nbsp;}&nbsp;for(i=1; i<4; i++ )&nbsp;{&nbsp;for (j=0; j<7; j++) xm[j][i]+=b/10;&nbsp;i++;&nbsp;}&nbsp;for (i=0; i<7;i++) line(xm[i][0],xm[i][1],xm[i][2],xm[i][3]);&nbsp;delay(100000);&nbsp;cleardevice();&nbsp;}&nbsp;getch();&nbsp;closegraph();&nbsp;return 0;&nbsp;}&nbsp;
打开App,查看更多内容
随时随地看视频慕课网APP