#include<stdio.h> int main() { int n =0,qing[50]={0}; scanf("%d ",&n); for(int i = 0;i<n;++i) scanf("%d ",&qing[i]); int x =0; scanf("%d ",&x); for(int i = 0;i<n;++i) { if(qing[i]==x) continue; //如果与删除数字相同则跳过不打印 printf("%d ",qing[i]); } return 0; }
#include<stdio.h> int main() { int n =0,qing[50]={0}; scanf("%d ",&n); for(int i = 0;i<n;++i) scanf("%d ",&qing[i]); int x =0; scanf("%d ",&x); for(int i = 0;i<n;++i) { if(qing[i]==x) continue; //如果与删除数字相同则跳过不打印 printf("%d ",qing[i]); } return 0; }