摘要: #include <stdio.h>#include <stdlib.h>void point(char *pt);void point2(char *pt);void point3(char **pt);int main() { char b[4] = { 'a', 'c', 's', 'f' }; char *pt = b; point(pt); printf("%c\n", *pt); point2(pt); printf("%c\n", *pt); pt=b; 阅读全文
posted @ 2013-03-18 22:13 cart55free99 阅读(457) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> #include <string.h> #define CH "%c" #define DG "%d" //求最长的回文字串 判断回文不算符号 //但是最后输出的时候需要计算符号 //样例输入 //She say:Madam,I'm Adam. //样例输出 //Madam,I'm Adam int isHui(char str[],int start, int endi); int isLetter(char ch); in 阅读全文
posted @ 2013-03-18 15:27 cart55free99 阅读(271) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#define DG "%d\n"//字符串数组int main(){//长度问题============================ char arr[]= {"123"}; //定义的是一个字符串 char arr1[]= {'1','2','3'}; //一个字符数组//两者其实是有区别的//第一个相当于char arr[]={'1','2','3',& 阅读全文
posted @ 2013-03-17 21:26 cart55free99 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 奇偶校验介绍http://baike.baidu.com/view/93325.htm奇/偶校验(ECC)是数据传送时采用的一种校正数据错误的一种方式,分为奇校验和偶校验两种。如果是采用奇校验,在传送每一个字节的时候另外附加一位作为校验位,校验位在数据位前面,当实际数据中“1”的个数为偶数的时候,这个校验位就是“1”,否则这个校验位就是“0”,这样就可以保证传送数据满足奇校验的要求。在接收方收到数据时,将按照奇校验的要求检测数据中“1”的个数,如果是奇数,表示传送正确,否则表示传送错误。同理偶校验的过程和奇校验的过程一样,只是检测数据中“1”的个数为奇数。如0100101奇校验码就是`1010 阅读全文
posted @ 2013-03-15 14:07 cart55free99 阅读(798) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> main(){ char ch; int num[5]; int i=0; for(;i<5;i++){ scanf("%d",&num[i]);//注意 对于scanf中没有指定字符如何间隔 //默认是 回车 或 空格 或TAB 输入时用,分隔是不行的 } /*for(i=0;i<5;i++){ printf("%d ",num[i]); }*/ int sum=0; int zhengSum=... 阅读全文
posted @ 2013-03-15 13:30 cart55free99 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <string.h> #include <stdlib.h> //给定字串 寻找重复字符 并记录下位置 //若字串是"0aabb" 则输出a:1 a:2 b:3 b:4 int isExist(char distinct[],char ch); int addToExist(char distinct[],char ch); int countTimes(char str[],int len,char ch); main() { char str[]="abcaaAB12a 阅读全文
posted @ 2013-03-14 13:42 cart55free99 阅读(329) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <string.h> #include <stdlib.h> int isShouXing(int num); int numLength(int num); //寻找守形数 //守形数的平方低位时该数本身 //例如25*25=625 625的低位有25 main(){ //rintf("%d",numLength(55));//ok //printf("--%d",isShouXing(23));//ok int i=0; for(i=0;i<=100;i 阅读全文
posted @ 2013-03-14 11:00 cart55free99 阅读(445) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>int jiecheng(int num);int sum(int n);main(){ int num=0; scanf("%d",&num); //int rs=jiecheng(num); //printf("%d",rs); int sum1=0; int sum2=0; int num2; if(num%2==0){//是偶数 num2=num-1; }else{ num2=num-1; . 阅读全文
posted @ 2013-03-13 14:11 cart55free99 阅读(304) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>main(){ int m1=0;//指向最大数的下标 int m2=0;//指向次大数的下标 int a[4][5]={ 1,2,4,9,8, -1,4,9,6,8, 12,9,8,7,0, 7,8,9,7,0 }; int j=0; int i=0; for(;j<5;j++){ for(i=0;i<4;i++){ int temp=0;... 阅读全文
posted @ 2013-03-13 14:02 cart55free99 阅读(183) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>void toBin(int num,int arr[]);void andOp(int aBin[],int bBin[]);main(){int a;printf("input first\n");scanf("%d",&a);int b;printf("input se\n");scanf("%d",&b);int aBin[8]={0,0,0,0 阅读全文
posted @ 2013-03-13 14:00 cart55free99 阅读(264) 评论(0) 推荐(0) 编辑