第十六周OJ(2)
来源:互联网 发布:淘宝专柜国内代购真相 编辑:程序博客网 时间:2024/06/05 17:31
/* *Copyright(c)2014,烟台大学计算机学院 *Allrights reserved. *文件名称:MADE2.cpp *作 者:张生栋 *完成日期:2014年12月12日 *问题描述: *输入描述:略 *输出描述:略 *版 本 号:v1.0 **/#include<iostream>using namespace std;bool existthesame(int *a,int n1,int *b,int n2);int main(){ int a[50]; int b[50]; int n1, n2,*p; cin>>n1; for(p=a;p<a+n1;p++) cin>>*p; cin>>n2; for(p=b;p<b+n2;p++) cin>>*p; bool flag=existthesame(a,n1,b,n2); if(flag==true) cout<<"YES\n"; else cout<<"NO\n"; return 0;}bool existthesame(int *a,int n1,int *b,int n2){ int *p,*q,m; bool x=false; for(p=a;p<n1+a;p++) for(q=b;q<n2+b;q++) { if(*p==*q) m=1; } if(m==1) x=true; return x;}
运行结果:
0 0
- 第十六周OJ(2)
- 第十六周 OJ(A)
- 第十六周OJ(C)
- 第十六周OJ(D)
- 第十六周OJ(1)
- 第十六周OJ(3)
- 第十六周OJ(4)
- 第十六周oj平台(2):有相同数字?
- 第十六周OJ(2)职工信息结构体
- 第十六周OJ(B)
- 第十六周OJ题目
- 第十六周上机项目(oj)
- 第十六周 OJ:Money Problem
- 第十六周OJ题目(2)——有相同数字?
- 第十六周OJ项目2有相同数字?
- 第十六周OJ——2 有无相同数字
- 第十六周 OJ<2>---结构体---职工信息结构体
- 第十六周OJ项目1逆序输出数组(指针)
- 第16周 项目2-去除字符串str1中的特定字符(空格),结果仍保存在原字符串中<指针做参数>
- Mahout相关笔记
- 1、CocoaPods安装和使用教程
- S3C2440 flash 分区 nor nand FLASH区别(开发板启动时) 及 结构
- 原生JPA简单使用
- 第十六周OJ(2)
- 九度OJ 1334 占座位 (模拟 细心)
- HDU 4608 I-number
- Incorrect string value: '\xE6\x88\x91' for column 'username' at row 1
- 工会经费搞活动风格的分公司的
- 2、自己使用CocoaPod的经验
- Cocos2d-X3.0 刨根问底(六)----- 调度器Scheduler类源码分析
- Spark sql中的case when else
- 用uboot 烧写uboot linux内核 文件系统到nandflash的 过程以及bootm go命令启动与区别