C++ 本地编译器报错“连接器返回错误代码”

P1055 [NOIP2008 普及组] ISBN 号码

Mingqi @ 2023-07-18 11:31:52

#include <iostream>
#include <sstream>

using namespace std;

int main() {

    string isbn_before, sec_co, thi_co, fou_co, sec_st, thi_st;
    int fir = 0, sec = 0, thi = 0, fou = 0;
    int sec_cop, thi_cop;
    cin >> isbn_before;

    stringstream convert;
    for (int i = 2; i <= 4; ++i) {
        sec_co = isbn_before[i];
        convert << sec_co;
        convert >> sec_cop;
        sec += i * sec_cop;
    }

    return 0;
}

程序还没写完,想着运行试一下结果提示“连接器返回错误代码”,请问这样一般是哪里出错了?qwq


by jtshw @ 2023-07-18 11:41:41

@Mingqi 我以前也是的,我就把DEV-C++重新安装了一下就好了,可以试试(但不一定有用)


by Mingqi @ 2023-07-18 12:46:29

@jtshw 解决了,感谢!我想着重装太麻烦了,就把DEV-C++关了又打开,没想到就好了


by H_com_2012 @ 2023-07-27 19:52:58

666


|