杭电2034这题怎么做啊#includeint main(){int a[100],b[100],c[100];int n,m,i,t,k;while(scanf("%d%d",&n,&m)!=EOF){ if(n==0&&m==0) break;for(i=0;i
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/01 08:18:04
杭电2034这题怎么做啊#includeint main(){int a[100],b[100],c[100];int n,m,i,t,k;while(scanf("%d%d",&n,&m)!=EOF){ if(n==0&&m==0) break;for(i=0;i
杭电2034这题怎么做啊
#include
int main()
{
int a[100],b[100],c[100];
int n,m,i,t,k;
while(scanf("%d%d",&n,&m)!=EOF)
{
if(n==0&&m==0) break;
for(i=0;i
杭电2034这题怎么做啊#includeint main(){int a[100],b[100],c[100];int n,m,i,t,k;while(scanf("%d%d",&n,&m)!=EOF){ if(n==0&&m==0) break;for(i=0;i
//
#include
int main()
{
int a[100],b[100],c[100];
int n,m,i,t,k;
while(scanf("%d%d",&n,&m) != EOF)
{
if(n == 0 && m == 0) break;
for(i = 0; i < n; i++)
scanf("%d",&a[i]);
for(i = 0; i < m; i++)
scanf("%d",&b[i]);
for(k = i = 0; i < n; i++)
{
// k = 0;
for(t = 0; t < m; t++)
{
if(a[i] == b[t]) break;
// else k++;
}
if(t == m)c[k++] = a[i]; //应该把a[i] 赋值给 c[k]
}
if(k == 0)printf("NULL");
else
{
for(i = 0; i < k; i++) //从小到大输出结果,
for(t = 0; t