提交时间:2022-12-04 13:55:50

运行 ID: 6498

#include <iostream> using namespace std; int main() { int a[21],m,n,b=0; cin>>n; for (int i=1; i<=n; i++) { cin>>a[i]; } cin>>m; for (int x=1; x<=n; x++) { if(a[x]==m) { b=x; break; } } for (int q=1;q<=n;q++){ if(q!=b){ cout<<a[q]<<" "; } } }