随笔分类 - C语言
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <ctype.h> 4 #include <string.h> 5 typedef int ElemType; 6 typedef struct Queue{ 7 ElemType item;
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <ctype.h> 4 #include <string.h> 5 typedef int ElemType; 6 typedef struct Queue{ 7 ElemType *item
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <ctype.h> 4 #include <string.h> 5 typedef int ElemType; 6 typedef struct item{ 7 ElemType items;
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <ctype.h> 4 #include <string.h> 5 typedef int ElemType; 6 typedef struct stack{ 7 ElemType *item
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 #include<ctype.h> 5 #define NAME 20 6 #define SEX 6 7 typedef struct item{ 8 char *nam
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <ctype.h> 4 #include <string.h> 5 #define NAME 20//分配空间大小 6 #define SEX 6//分配空间大小 7 typedef stru
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <ctype.h> 4 #include <string.h> 5 #define NAME 20 6 #define SEX 6 7 typedef struct LinkList{ 8 c
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <ctype.h> 4 #include <stdbool.h> 5 #define MAXSIZE 7 6 typedef int ElemType; 7 typedef struct Or
阅读全文
摘要:1 #include<stdio.h> 2 #include<stdlib.h>//malloc 3 #include<stdbool.h> 4 #include<string.h> 5 #include<ctype.h> 6 #define SIZE 12 //姓名字符串大小为12个字符,包含空字
阅读全文
摘要:这次实现的是递归,通过递归,我们可以尽量的减少代码量来实现功能。但缺点是递归的每层级调用都会耗掉一部分的内存。 1 int tobinary(int a){ 2 if(a/2) 3 printf("%d",tobinary(a/2)); 4 return a%2; 5 } 6 void main(v
阅读全文
摘要:利用stdarg.h库支持的宏函数来接收数据实现储存任意大小的数组 1 #include<stdio.h> 2 #include<stdlib.h>//malloc 3 #include<stdarg.h>//宏支持原型 4 #define SIZE 5 5 double * CreateArray
阅读全文
摘要:1 void main(void){ 2 unsigned int d=0; 3 char c[10]="居中",y; 4 /* 5 类型 0~7 6 大小 8~15 7 对齐方式 16~17 8 粗体 18 9 斜体 19 10 下划线 20 11 */ 12 unsigned int x; 13
阅读全文
摘要:1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <ctype.h> 5 #include <math.h> 6 typedef struct{//类型定义another变量为该结构原型 7 cha
阅读全文
摘要:要求如下 void prtf(double * a,double * b,double *c){ double max,min,th,sum=*a+*b+*c; max= *a > ( *b > *c ? *b : *c) ? *a : ( *b > *c ? *b : *c);//取最大值 //a
阅读全文
摘要:在学习C语言时,我遇到了一个难题,题目是这样的,折腾了半天 1 #include<stdio.h> 2 void main(void){ 3 char ch,y='A'; 4 scanf("%c",&ch); 5 int x=ch-y,a,b,c; 6 //X记录需要循环的次数,a负责循环控制每行的
阅读全文
浙公网安备 33010602011771号