const\text{const}const 是个函数可以将一个变量锁死,不能改变 for example\text{for example}for example: C++复制#include <bits/stdc++.h> using namespace std; const n=10; int main() { n=20; cout<<n; return 0; } 输出的是 101010 而并非 202020。