#include <iostream>
using namespace std;
#define day 7
/*
定义宏常量方法
#define 宏常量名 常量值 //通常在文件上方定义,表示一个常量;
const修饰的变量 const 数据类型 变量名 = 常量值;//通常在变量定义前使用const修饰该变量为常量 不可修改
*/
int main()
{
//变量创建语法:数据类型 变量名 = 变量初始值;
int a = 10;
cout << "a = " << a << endl;
cout << "一周有" << day << "天" << endl;
//利用const修饰常量
const int month = 12;
cout << "一年有" << month << "月" << endl;
cout << "Hello World" << endl;
system("pause");
return 0;
}
« github下载速度慢解决方法
|
raspbian ros安装»
|