int main()
{
int n, inInt;
vector <int> list;
ifstream ifs("1.txt");
float a;
ifs >> a;
std::vector<int> result;
int temp;
while(! ifs.eof())
{
ifs >> temp;
result.push_back(temp);
}
int b;
b = result.size();
float array[b+1];
int i;
array[0] = a;
for(i = 1;i < b+1;i++) {
array[i] = (array[i-1] + result[i]-2*array[i-1] * result[i]/a);
}
cout << array[b];
system("pause");
return 0;}
기본적으로 내 코드에서 벡터를 작성하고 배열을 작성한 다음 배열의 벡터에서 데이터를 사용하려고합니다. 그러나 텍스트를 입력하면 코드가 잘못되었습니다. 번호.C++ 벡터 배열 오류
했다. 해답이 초기 문제를 해결했지만 해결할 수없는 새로운 문제가 발생하면 새로운 질문을 게시하십시오. – ChrisF