问题描述
代码可以完美地构建和运行,但我无法调试我的代码。我是 M1 Macbook Pro 用户,我认为问题出在那里。活动监视器中显示的 Clion 架构是 Intel。 代码退出,代码 139- 中断信号 11- SIGSEGV- 分段错误。
error message after attempting to debug the code
代码
// 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;
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)