#include<iostream> using namespace std; void main(){ int n,m; while(cin>>n>>m){ if(n==0&&m==0) break; int sa[100],sb[100]; for(int i=0;i<n;++i){ cin>>sa[i]; } for(int j=0;j<m;++j){ cin>>sb[j]; } for(int k=n;k;--k){ for(int gg=1;gg<k;++gg){ if(sa[gg]<sa[gg-1]) { int t; t=sa[gg]; sa[gg]=sa[gg-1]; sa[gg-1]=t; } } } int count=0; for(int w=0;w<n;++w){ bool t=true; for(int q=0;q<m;++q){ if(sa[w]==sb[q]) { t=false; ++count; break; } } if(t) cout<<sa[w]<<" "; } if(count==n) cout<<"NULL"; count=0; cout<<endl; } }
杭电ACM 第2034题
最新推荐文章于 2022-01-30 15:02:51 发布