帮看看这个程序怎样能用vc++调出来?!谢谢!

来源:百度知道 编辑:UC知道 时间:2024/05/16 14:36:08
#include<stdio.h>
#include<string.h>
#include <graphics.h>
float x1,x2,x3,x4,y1,y2,y3,y4;
void menu();
void date();
void draw();
void work();
main()
{float n ;
while(1)
{
menu();
scanf("%f",&n);
switch(getchar())
{case 'A': date();break;
case 'B': draw();break;
case 'C': work();break;
case 'D': exit(0);
default: printf("ERROR ! \n ");
}}}
void menu()
{
printf("\n welcome \n\n");
printf(" CHOOSE the function you will use. \n\n");
printf(" A:input the coordinates \n");
printf(" B:draw the lines \n");
printf(" C:account nodical coordinate \n");
printf("

VC++不能调出来.

原因是VC++没有TC的头文件graphics.h和它里面定义的绘图函数. VC++ 用CDC类里的绘图函数,功能很强,但要复杂些.

必须重新设计程序,特别是重新写绘图部分的语句.才可能调出来.

你用VC++创建一个win32 console类型的工程,然后把这段代码拷贝进去,编译就可以了。