求大佬帮我看一下C语言代码哪里出错了?

2024-11-29 04:45:50
推荐回答(2个)
回答1:

#include

int main() { int i,n,x,a[10],*res;

  printf("Input n:\n"); scanf("%d",&n);

  printf("Input %d numbers:\n",n); for(i=0;i

  res=a; printf("Input x:\n"); scanf("%d",&x);

  for(i=0;i

  if ( i

}

回答2:

if(a[i]!='x') 改成if(a[i]!=x) ‘x’里面是字符