c++学习笔记02--变量与常量
1.变量的定义与输出
#include <iostream>
using namespace std;
int main() {
int a = 10;
cout << "a = "<< a << endl;
system("pause");
return 0;
}
2.常量的定义与输出
常量定义两种方法
-
- 宏定义
- const定义
#include <iostream>
using namespace std;
#define a 50
int main() {
cout << "a = "<< a << endl;
const int b = 60;
cout << "b = " << b << endl;
system("pause");
return 0;
}

浙公网安备 33010602011771号