运行以下代码出现这个问题,代码是vc6复制来的,搞不懂,是不是少了什么插件,我已经安装了ezsyx,不知道win11还可以用其它的c语言软件不
调试结果如下
#include<stdio.h> //显示输出输入
#include <conio.h> //定义getch函数
#include <stdlib.h> //定义srand函数
#include <string.h> //调用字符串的头文件,与字符串的调用有关
#include <math.h>
#include <windows.h>
#define UP 72
#define DOWN 80
#define LEFT 75
#define RIGHT 77
#define ENTER 13
//自定义函数说明
void gotoxy(int x, int y); //定位光标
void HideCursor(int con); //隐藏光标
void menu1(int cur); //当前菜单
void menu_init(); //初始菜单
unsigned char keypressed(void); //控制按键
int function(int option); //菜单选项
void welcome(void); //程序开机界面
void f1(); // 功能1)
void f2(); // 功能2)
void f3(); // 功能3)
void f4(); // 功能4)
void f5(); // 功能5)
void f6(); // 功能6)
void f7(); // 功能7)
void f8(); // 功能8)
void f9(); //功能9)退出
void gotoxy(int x, int y)
{
COORD c = { x,y }; //COORD:实现光标随方向键移动
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), c); //设置控制光标位置
}
void HideCursor(int con) //隐藏光标 con:const(常数)
{
CONSOLE_CURSOR_INFO cursor_info = { 1,con }; //控制光标信息
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void welcome() //菜单
{
printf("\t■=====================================================■\n");
printf("\t‖*****************************************************‖\n");
printf("\t‖····C语言第*次大作业·· ··多功能系统····‖\n");
printf("\t‖*****************************************************‖\n");
printf("\t■=====================================================■\n");
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main()
{
int i = 0;
unsigned char key = 0;
while (1)
{
HideCursor(0);//隐藏光标
system("cls");//清屏
welcome(); //欢迎界面
menu_init();//初始菜单
while (1)
{
key = keypressed();//按键查询
if (key != ENTER)
{
switch (key) //按上下键实现箭头的移动
{
case UP:
i = i - 1;
if (i < 0)
{
i = 0;
}
menu1(i);//更新菜单
break;
case DOWN:
i = i + 1;
if (i > 8)
{
i = 8;
}
menu1(i);//更新菜单
break;
}
}
else if (key == ENTER)
break;
}//按键检测循环
HideCursor(1);//显示光标
function(i);
}
return 1;
}
//////////////////////////////////////////////////////////////////////////////
unsigned char keypressed()//有按键返回ascii码,没有按键返回值是0
{
unsigned char sel = 0;
if (kbhit()) //无停顿
{
sel = getch(); //敲击不显示
if (sel >= 128)
sel = getch(); //敲击不显示
}
return sel;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void menu_init()
{
gotoxy(9, 8);
printf("1)素数查询");
gotoxy(9, 9);
printf("2)完数查询");
gotoxy(9, 10);
printf("3)温度互换");
gotoxy(9, 11);
printf("4)天数查询");
gotoxy(9, 12);
printf("5)鸡兔同笼");
gotoxy(9, 13);
printf("6)图形输出");
gotoxy(9, 14);
printf("7)功能7");
gotoxy(9, 15);
printf("8)功能8");
gotoxy(9, 16);
printf("9)退出程序");
}
void menu1(int cur)
{
int x;
for (x = 0; x < 9; x++)
if (x == cur)
{
gotoxy(7, 8 + x);
// printf("\003");
printf("->");
}
else
{
gotoxy(7, 8 + x);
printf(" ");
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int function(int option)
{
switch (option) //选择
{
case 0:
f1(); // 1)
break;
case 1:
f2(); // 2)
break;
case 2:
f3(); // 3)
break;
case 3:
f4(); // 4)
break;
case 4:
f5(); // 5)
break;
case 5:
f6(); // 6)
break;
case 6:
f7(); // 7)
break;
case 7:
f8(); // 8)
break;
case 8: f9(); //9)
break;
}
return 0;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void f1()
{
system("cls");
printf("功能1):\n");
getch();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void f2()
{
int i, j, k;
system("cls");
printf("完数查询\n");
getch();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void f3()
{
int i;
system("cls");
printf("功能3\n");
getch();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void f4()
{
int i;
system("cls");
printf("功能4n");
getch();
}
//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void f5()
{
system("cls");
printf("功能5):\n");
getch();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void f6()
{
system("cls");
printf("功能6):\n");
getch();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void f7()
{
system("cls");
printf("功能7):\n");
getch();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void f8()
{
system("cls");
printf("功能8):\n");
getch();
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void f9()
{
system("cls");
printf("\n\t欢迎再次使用! \n 请按任意键退出程序\n");
printf("\n");
exit(0); //程序正常退出
}
你创建的是什麽类型的工程?