自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 资源 (3)
  • 收藏
  • 关注

原创 2017-7-28 2-8 编写函数rightrot(x,n),该函数返回将x循环右移(即从最右端移出的位将从最左端移入)n位后所得到的值

#include <stdio.h>#include <stdlib.h>int wordlength(void){ int t; unsigned v=(unsigned)~0;// 这里要尤其注意unsigned的使用 ,unsigned 左移 右移都补0 for(t=1;(v=v>>1)>0;t++) { ...

2018-07-28 18:14:24 872

原创 2017-7-28 2-7 编写函数invert(x,p,n),该函数返回对x执行下列操作后的结果值:将x中从第p位开始的n个(二进制)位求反,x的其余位保持不变

#include <stdio.h>#include <stdlib.h>unsigned invert(unsigned int x,int p,int n){ return x^ (~(~0<<n)<<(p+1-n)); //异或操作 1^1=0 0^0=0 1^0=1 0^1=1 //用或操作,已完成,比较麻烦 ...

2018-07-28 17:40:41 441

原创 2017-7-28 2-6 编写函数setbits(x,p,n,y),该函数返回对x执行下列操作后的结果值: 将x中从第p位开始的n个(二进制)位设置为y中最右边的n位的值,x的其余位保持不变

#include <stdio.h>#include <stdlib.h>unsigned setbits(unsigned int x,int p,int n,unsigned int y){ return ( x & (~((~(~0<<n))<<(p+1-n))) ) | ...

2018-07-28 16:54:25 699

原创 2017-7-28 2-5 编写函数any(s1,s2), 将字符串s2中任一字符在字符串s1中第一次出现的位置作为返回结果,如果s1中不包含s2中的字符,则返回-1

#include <stdio.h>#include <stdlib.h>int any( char s1[], char s2[] ){ int i=0,j=0; for(i=0; s1[i]!='\0'; i++) // ' \0 ' 字符串结束符 { for(j=0; s2[j] != '\0'&& j<...

2018-07-28 12:46:06 1127

原创 2017-7-18 2-4 编写函数squeeze(s1,s2), 将字符串s1中任何与字符串s2中字符匹配的字符都删除。

#include<stdio.h>#include<string.h>/************************************************************************************* 编写函数squeeze(s1,s2), 将字符串s1中任何与字符串s2中字符匹配的字符都删除。*********...

2018-07-20 01:03:38 720 1

原创 2018-7-20 《小王子》 chapter 4 第四天 打卡

2018-07-20 00:12:03 159

原创 2017-7-18 2-3 编写函数htoi(s), 将十六进制的字符串(包含0x或0X)转换为与之等价的整形值,字符串中允许包含的数字:0~9,a~f,A~F

#define YES 1#define NO 0 int htoi(char s[]){ int hexdigit,i,inhex,n; i=0; if(s[i]=='0') { ++i; if(s[i]=='x' || s[i]=='X') { ++i; } } n=0; inhex=YES; for( ;inhex==YES; ++i) {...

2018-07-19 00:29:15 596

原创 2017-7-18 第三天 《小王子》 chapter 3

  

2018-07-19 00:25:47 146

转载 C语言 运算符优先级

C语言 运算符优先级

2018-07-18 10:23:22 139

原创 2017-7-17 2-2 不使用&&和|| 编写一个与debug1中for循环等价的循环语句

#include<stdio.h>#define debug1 0#define debug2 1int i,lim=10;char c,s[10];enum loop {NO,YES};enum loop okloop =YES;main(){#if debug1 for(i=0;i<lim-1&&(c=getchar())!='\n'&...

2018-07-18 00:29:01 107

原创 2017-7-17 第二天 《小王子》 chapter 2

  

2018-07-17 23:59:20 185

原创 2018-7-16 2-1 分别由signed 和unsigned 限定的 char,short,int,long类型变量的取值范围

#include<stdio.h>#include<limits.h>#define debug1 0 //使用debug1 必须包含limits.h#define debug2 1main(){ #if debug1 //signed types printf("signed char min = %d \n",SCHAR_MIN); pr...

2018-07-17 00:27:26 223

原创 第一天 发表试试

    

2018-07-16 10:45:12 106

模糊PID 控制算法

matlab平台的模糊pid程序设计,能正常仿真

2015-05-20

智能家居系统实现

智能家居的设计实现包括代码,电路图,安卓应用等等

2015-05-20

mini2440用户手册

mini2400的用户手册,是友善之臂的

2014-05-06

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除