FortranC++

😎C++--常量定义2

2019-05-23  本文已影响0人  JiehongYOU
const 声明 常量
#include <iostream>
using namespace std;

int main(void) {
    const int LENGTH = 20;
    const int WIDTH = 10;

    int area = WIDTH * LENGTH;

    cout << "Area is:" << area;

    system("pause");
    return 0;
}
结果
result.png
上一篇 下一篇

猜你喜欢

热点阅读