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;
}
#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;
}
本文标题:😎C++--常量定义2
本文链接:https://www.haomeiwen.com/subject/qgnvzqtx.html
网友评论