请帮助我Here is a problem of Codechef 。这是我的提交内容:
#include <stdio.h>
#define M 60
int main()
{
int i,arr[M],input;
int s=0;
puts("Input:");
for(i=0;;i++){
scanf("%d",&input);
if(input==42){
scanf("%d");
break;
}
else{
arr[i]=input;
s++;
}
}
puts("Output:");
for(i=0;i<s;i++){
printf("%d\n",arr[i]);
}
return 0;
}
当我创建代码时,它在 GCC 4.9.2 上成功运行,但是当我提交此代码时,Codechef 说它有运行时错误。我尝试过但找不到错误。 所以 请帮我找出错误...
最佳答案
第二个 scanf 中的变量丢失
关于c - 测试 - 运行时错误 SIGSEGV,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50823353/