用C++编程图案出现先错误求解!!!
#include"stdio.h"#include"conio.h"intmain(){printf("┏━┓┏━┓\n");printf("┃┃┃┃┃┃\n");pri...
#include"stdio.h"
#include"conio.h"
int main()
{
printf(" ┏━┓┏━┓\n");
printf(" ┃┃┃┃┃┃\n");
printf(" ┃┃┃┃┃┃\n");
printf("┏┛┃┗┛┃┗┓\n");
printf("┃ ┃ \n");
printf("┃ ┃ \n");
printf("┃━━ ﹏ ━━ ┃ \n");
printf("┃ ┃ \n");
printf("┗━━━━━━┛ \n");
getch()
return 0;
} 展开
#include"conio.h"
int main()
{
printf(" ┏━┓┏━┓\n");
printf(" ┃┃┃┃┃┃\n");
printf(" ┃┃┃┃┃┃\n");
printf("┏┛┃┗┛┃┗┓\n");
printf("┃ ┃ \n");
printf("┃ ┃ \n");
printf("┃━━ ﹏ ━━ ┃ \n");
printf("┃ ┃ \n");
printf("┗━━━━━━┛ \n");
getch()
return 0;
} 展开
5个回答
展开全部
不要用#include"conio.h"了,另外getch()也不要了,getchar()更不要加,因为加这些东西的话,底下会有缓冲,不如不加。,代码如下:
#include"stdio.h"
//#include"conio.h"
int main()
{
printf(" ┏━┓┏━┓\n");
printf(" ┃┃┃┃┃┃\n");
printf(" ┃┃┃┃┃┃\n");
printf("┏┛┃┗┛┃┗┓\n");
printf("┃ ┃ \n");
printf("┃ ┃ \n");
printf("┃━━ ﹏ ━━ ┃ \n");
printf("┃ ┃ \n");
printf("┗━━━━━━┛ \n");
//getchar();
return 0;
}
#include"stdio.h"
//#include"conio.h"
int main()
{
printf(" ┏━┓┏━┓\n");
printf(" ┃┃┃┃┃┃\n");
printf(" ┃┃┃┃┃┃\n");
printf("┏┛┃┗┛┃┗┓\n");
printf("┃ ┃ \n");
printf("┃ ┃ \n");
printf("┃━━ ﹏ ━━ ┃ \n");
printf("┃ ┃ \n");
printf("┗━━━━━━┛ \n");
//getchar();
return 0;
}
追问
请问如果想让图案变色要如何编程?
追答
我不知道你用的编译器是不是在linux下的,不过这些宏定义你可以试试:
#define NONE "\033[m"
#define RED "\033[0;32;31m"
#define LIGHT_RED "\033[1;31m"
#define GREEN "\033[0;32;32m"
#define LIGHT_GREEN "\033[1;32m"
#define BLUE "\033[0;32;34m"
#define LIGHT_BLUE "\033[1;34m"
#define DARY_GRAY "\033[1;30m"
#define CYAN "\033[0;36m"
#define LIGHT_CYAN "\033[1;36m"
#define PURPLE "\033[0;35m"
#define LIGHT_PURPLE "\033[1;35m"
#define BROWN "\033[0;33m"
#define YELLOW "\033[1;33m"
#define LIGHT_GRAY "\033[0;37m"
#define WHITE "\033[1;37m"
int main()
{
printf("\033[32m 卡尔 \033[31m" "hello world!\n" "\033[m");
return 0;
}全部是使输出变换呈现相应的颜色
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
#include<stdio.h>
int main()
{
printf(" ┏━┓┏━┓\n");
printf(" ┃┃┃┃┃┃\n");
printf(" ┃┃┃┃┃┃\n");
printf("┏┛┃┗┛┃┗┓\n");
printf("┃ ┃ \n");
printf("┃ ┃ \n");
printf("┃━━ ﹏ ━━┃ \n");
printf("┃ ┃ \n");
printf("┗━━━━━━┛ \n");
getchar();
return 0;
}
试试这个
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
getch();//除了这里少两个分号,没有其他错误啊?
return 0;
return 0;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
gtech()函数后少个分号。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询