杭电2034人人都爱A-B#include#include#include#define N 102int main(){ int a,b,c,d; int arr[N],brr[N],crr[N],drr[N]; while(scanf("%d %d",&a,&b)!=EOF&&a&&b) { memset(arr,0,sizeof(arr)); memset(brr,0,sizeof(brr)); me
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 08:17:38
杭电2034人人都爱A-B#include#include#include#define N 102int main(){ int a,b,c,d; int arr[N],brr[N],crr[N],drr[N]; while(scanf("%d %d",&a,&b)!=EOF&&a&&b) { memset(arr,0,sizeof(arr)); memset(brr,0,sizeof(brr)); me
杭电2034人人都爱A-B
#include
#include
#include
#define N 102
int main()
{
int a,b,c,d;
int arr[N],brr[N],crr[N],drr[N];
while(scanf("%d %d",&a,&b)!=EOF&&a&&b)
{
memset(arr,0,sizeof(arr));
memset(brr,0,sizeof(brr));
memset(crr,0,sizeof(crr));
memset(drr,1,sizeof(drr));
for(int i=0;i scanf("%d",&arr[i]);
for(int i=0;i scanf("%d",&brr[i]);
c=0;
int ok;
for(int i=0;i {
ok=1;
for(int j=0;j if (arr[i] == brr[j])
{
ok = 0;
break;
}
if (ok)
crr[c++] = arr[i];
}
if(c==0)
{
printf("NELL");
}
for(int j=1;j
{
int t=crr[i];
crr[i]=crr[i+1];
crr[i+1]=t;
}
for(int i=0;i
for(int j=i+1;j
{
drr[i]=0;
}
}
for(int i=0;i
printf("%d ",crr[i]);
printf("\n");
}
return 0;
}
提交就是错误.
杭电2034人人都爱A-B#include#include#include#define N 102int main(){ int a,b,c,d; int arr[N],brr[N],crr[N],drr[N]; while(scanf("%d %d",&a,&b)!=EOF&&a&&b) { memset(arr,0,sizeof(arr)); memset(brr,0,sizeof(brr)); me
#include
#include
#include
#define N 102
int main()
{
int a,b,c,d;
int arr[N],brr[N],crr[N],drr[N];
while(scanf("%d %d",&a,&b)!=EOF&&(a||b))
{
memset(arr,0,sizeof(arr));
memset(brr,0,sizeof(brr));
memset(crr,0,sizeof(crr));
memset(drr,1,sizeof(drr));
for(int i=0;i