如何初始化一维vector? string s;//s是函数参数传递过来的 n = s.length(); 方法一 vector<int> dp(n, 0);//将所有元素初始化为0 方法二 int a[10001];//10000表示s的最大长度