下列代码输出为 0,但去掉第 6 行后输出为 1。
0
1
#include<bits/stdc++.h> using namespace std; int tot; vector<int>a; int add(){ a.push_back(2); tot++; return tot; } int main(){ a.push_back(0); a[0]=add(); printf("%d",a[0]); return 0; }