题解
2023-07-04 19:07:46
发布于:上海
18阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;//输入n
cin>>n;
int numlist[n];//建立n长度数字数组
for(int i=0;i<n;i++){
cin>>numlist[i];//输入数字
}
int m;cin>>m;//输入m
bool temp=false;//定义是否出现m
for(int i=0;i<n;i++){
if(numlist[i]m and tempfalse){
temp=true;//改变temp
}
else{
cout<<numlist[i]<<" ";
}
}
cout<<endl;
return 0;
}
这里空空如也
有帮助,赞一个