c程序
来源:互联网 发布:微商达人软件代理加盟 编辑:程序博客网 时间:2024/05/16 12:13
/*
* bu.c
*
* Created on: 2016年12月13日
* Author: Administrator
*/
#include<stdbool.h>
#include<stdio.h>
int a[10]={1,3,5,8,9,12,46,78,4,10};
bool search(const int a[],int n,int key);
int main(void)
{
int i,n=10;
scanf("%d",&i);
if(search(a,n,i))
printf("key is in the array\n");
return 0;
}
bool search(const int a[],int n,int key)
{
int *p;
for(p=a;p<&a[n];p++)
{
if(*p==key)
return true;
}
return false;
}
* bu.c
*
* Created on: 2016年12月13日
* Author: Administrator
*/
#include<stdbool.h>
#include<stdio.h>
int a[10]={1,3,5,8,9,12,46,78,4,10};
bool search(const int a[],int n,int key);
int main(void)
{
int i,n=10;
scanf("%d",&i);
if(search(a,n,i))
printf("key is in the array\n");
return 0;
}
bool search(const int a[],int n,int key)
{
int *p;
for(p=a;p<&a[n];p++)
{
if(*p==key)
return true;
}
return false;
}
0 0
- C程序
- c 程序
- C程序
- C程序
- c程序。
- c程序
- c 程序
- c程序
- C程序
- C程序
- c程序
- c程序
- c程序
- c程序
- C程序
- c程序
- c程序
- c程序
- Linux常用指令
- SQL练习 demo6_group by_having分组约束的应用
- QQ空间 代码秒赞
- Java反射机制详解
- JFreeChart学习(二)-动态生成图表,并设置图表的字体格式,显示样式
- c程序
- 常涉及的图像特征
- linux下安装svn
- 字符串插入
- 手机号码检测开通微信
- 我的试验__mybatis中resultType使用javaBean和Map的区别
- Ubuntu增加Swap空间大小
- python操作excel的包(openpyxl, xlsxwriter)
- 从尾到头打印链表