004.常量

#include <iostream>
using namespace std;

//常量的定义方式
//1.#define宏常量
//2.const修饰的变量



 //1.#define宏常量
#define Day 7

int main()
{
    //2.const修饰的变量
    const int month = 12;

    cout << "一周有"<<Day <<""<< endl;
    cout << "一年有" << month << "月份" << endl;
    system("pause");  //按任意键继续
    return 0;
}

 

posted @ 2021-09-02 21:57  梦之心  阅读(25)  评论(0编辑  收藏  举报