c - 如何在c中为不同的功能设置不同的颜色
问题描述
我想为 main 和 add 功能设置两种不同的颜色。但是这样,当执行 add 函数时,整个输出文本颜色变成红色。
#include<stdio.h>
#include<windows.h>
int add(a,b){
system("Color 4");
printf("the sum of two numbers %d",a+b);
}
int main(){
int a,b;
system("Color A");
printf("\nEnter two numbers\n");
scanf("%d %d",&a,&b);
add(a,b);
return 0;
}
解决方案
推荐阅读
- node.js - Argon2 与节点 docker 容器
- css - 顶部和底部有 td 内容的表格
- sql - 无法在 PostgreSQL 中创建别名
- python-3.x - 检查目标时出错:预期 dense_2 的形状为 (45, 20) 但得到的数组的形状为 (45, 1)
- python - 如何从文本文件中为不同的功能运行计数
- amadeus - 航班预订确认
- matlab - 是否可以在 Matlab 中绘制带有填充图案的条形图
- python - ModuleNotFoundError:没有以 virtualenv 命名的模块,需要了解如何为生产构建它
- python - 切片张量的每个原始数据
- sql - SQL - 多部分标识符错误:无法绑定多部分标识符“OBDATE.SUMMARY_BLOCK_ID”