摘要: 这次实现的是递归,通过递归,我们可以尽量的减少代码量来实现功能。但缺点是递归的每层级调用都会耗掉一部分的内存。 1 int tobinary(int a){ 2 if(a/2) 3 printf("%d",tobinary(a/2)); 4 return a%2; 5 } 6 void main(v 阅读全文
posted @ 2020-05-10 12:11 四字又名 阅读(220) 评论(0) 推荐(0)
摘要: 利用stdarg.h库支持的宏函数来接收数据实现储存任意大小的数组 1 #include<stdio.h> 2 #include<stdlib.h>//malloc 3 #include<stdarg.h>//宏支持原型 4 #define SIZE 5 5 double * CreateArray 阅读全文
posted @ 2020-05-05 12:31 四字又名 阅读(353) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-05-03 11:16 四字又名 阅读(353) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-04-30 14:19 四字又名 阅读(175) 评论(0) 推荐(0)
摘要: 要求如下 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 阅读全文
posted @ 2020-04-23 14:44 四字又名 阅读(270) 评论(0) 推荐(0)
摘要: 在学习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负责循环控制每行的 阅读全文
posted @ 2020-04-21 23:03 四字又名 阅读(564) 评论(0) 推荐(0)