随笔分类 - C语言
摘要:#include #include #define uchar unsigned char #define uint unsigned int /**tatle_du数组数据为0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,H,L**/ uchar code tatle_du[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d, 0x7d,0x07,0x...
阅读全文
摘要:1 #include<stdio.h> 2 #include<stdlib.h> 3 4 struct chain 5 { 6 int num; 7 float score; 8 struct chain *next; 9 }; 10 11 //创建新链表 12 struct chain *crea
阅读全文
摘要:游程编码问题请实现游程编码的编码函数和解码函数。提示:游程编码的概念是, 给一块数据,如:0x11 0x11 0x11 0x22 0x33 0x33 0x33 0x33 0x33, 那么游程编码的结果是:0x11 0x3 0x22 0x1 0x33 0x5 //主函数 1 #include <std
阅读全文
摘要:判断两个字符串的大小 1 #include <stdio.h> 2 3 int my_strcmp(const char *str1,const char *str2) 4 { 5 //判断两个字符串是否为空 6 if((str1 == NULL) && (str2 == NULL)) 7 { 8
阅读全文
摘要:实现两个字符串相连 1 #include<stdio.h> 2 #include<string.h> 3 4 //把源字符串连接到目的字符串中 5 char *strcat1(char *dest,const char *src) 6 { 7 int i=0; 8 int n=strlen(dest
阅读全文
摘要:输入一个整数,将各位数字反转后输出 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int inversion(unsigned int num) 5 { 6 int ret=0; //定义返回值 7 int remainder; //定义一个余数 8
阅读全文
摘要:猴子第一天摘下N个桃子,当时就吃了一半,还不过瘾,就又吃了一个。第二天又将剩下的桃子吃掉一半,又多吃了一个。 以后每天都吃前一天剩下的一半零一个。到第10天在想吃的时候就剩一个桃子了,求第一天共摘下来多少个桃子? 1 #include<stdio.h> 2 3 int main() 4 { 5 un
阅读全文