#include <iostream> using namespace std; int main() { int a = 10; cout << "a = "<< a << endl; system("pause"); return 0; }
常量定义两种方法
#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; }