在 M1 Macbook Pro 上使用 CLion 进行调试

时间:2020-12-22 11:40:08

标签: c++ debugging intel clion apple-m1

代码可以完美地构建和运行,但我无法调试我的代码。我是 M1 Macbook Pro 用户,我认为问题出在那里。活动监视器中显示的 Clion 架构是 Intel。 代码退出,代码 139- 中断信号 11- SIGSEGV- 分段错误。

error message after attempting to debug the code

intel architecture of Clion

代码

// Created by Kashita Talreja on 22/12/20.
//
#include<bits/stdc++.h>
using namespace std;


bool isvalid(int n) {
    int tmp = n;
    while(tmp) {
        int x = (tmp % 10);
        if(x > 0 && n % x >  0) return false;
        tmp /= 10;
    }
    return true;
}

void solve() {
    int n;
    cin >> n;
    int ok = 0;
    while(!isvalid(n)) {
        n++;
    }
    cout << n << endl;

}
int32_t main() {
    int t;
    cin>>t;
    while(t--) {
        solve();
    }
    return 0;
}

0 个答案:

没有答案