标签:n个元素 scan std efi panel 处理 author printf strong
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 100560 Accepted Submission(s): 28014
#include <iostream> #include <cstdio> #include <algorithm> #define inf 0x3f3f3f3f #define MAX 100000 using namespace std; int n,m; int a[100],b[100]; int ans[100],cnt; int main() { while(~scanf("%d%d",&n,&m) && (n + m)) { int nn = n; cnt = 0; for(int i = 0;i < nn;i ++) { scanf("%d",&a[i]); for(int j = 0;j < i;j ++) { if(a[i] == a[j]) { i --; nn --; break; } } } for(int i = 0;i < m;i ++) { scanf("%d",&b[i]); } for(int i = 0;i < nn;i ++) { int flag = 0; for(int j = 0;j < m;j ++) { if(a[i] == b[j]) { flag = 1; break; } } if(!flag) { ans[cnt ++] = a[i]; } } if(!cnt) printf("NULL\n"); else { sort(ans,ans + cnt); for(int i = 0;i < cnt;i ++) { printf("%d ",ans[i]); } putchar(‘\n‘); } } }
标签:n个元素 scan std efi panel 处理 author printf strong
原文地址:https://www.cnblogs.com/8023spz/p/9747799.html