呵呵,我电脑也不行,新人啊,记得上回一程序在win-tc下也是一闪而过,却不知为什么,用了getch();语句却不起效果,求解释
#include<graphics.h>
#include<math.h>
#include<dos.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<stdarg.h>
#define MAXPTS 15
#define PI 3.1415926
struct PTS{
int x;
int y;
};
double AspectRatio=0.85;
void LineToDemo(void)
{
struct viewporttype vp;
struct PTS points[MAXPTS];
int i,j,h,w,xcenter,ycenter;
int radius,angle,step;
double rads;
printf("MoveTo/LineTo Demonstration");
getviewsettings(&vp);
h=vp.bottom-vp.top;
w=vp.right-vp.left;
xcenter=w/2;
ycenter=h/2;
radius=(h-30)/(AspectRatio*2);
step=360/MAXPTS;
angle=0;
for(i=0;i<MAXPTS;++i)
{
rads=(double)angle*PI/180.0;
points[i].x=xcenter+(int)(cos(rads)*radius);
points[i].y=ycenter-(int)(sin(rads)*radius*AspectRatio);
angle+=step;
}
circle(xcenter,ycenter,radius);
for(i=0;i<MAXPTS;++i)
{
for(j=i;j<MAXPTS;++j)
{
moveto(points[i].x,points[i].y);
lineto(points[j].x,points[j].y);
}
}
}
main()
{
int driver;
int mode;
driver=CGA;
mode=CGAC0;
initgraph(&driver,&mode,"");
setcolor(3);
setbkcolor(GREEN);
LineToDemo();
getch();
}
为什么用了getch();语句却没效果