#include <iostream> using namespace std; int i = 1;int j = 2; int main(){ int i = 9; //C/C++中合法,Java中出现编译错误:变量已定义 int j = j; //C/C++中虽然合法,但是j在main内部重新声明,导致j的值未知。 cout << i << endl; cout << j << endl; return 0;}
Powered by: 博客园 Copyright © 2024 Code 詩亼 Powered by .NET 9.0 on Kubernetes