![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
巧妙的
小白o菜
Stay hungry, stay foolish!
展开
-
菜单调用各种函数
#include<stdio.h>#include<math.h>#define N 4void JudgePrime(){ int x,i; printf("\nPlease enter a number to judge whether it is a Prime.\n"); scanf("%d",&x); for (i=2;i<=(int...原创 2019-04-11 18:32:39 · 5855 阅读 · 5 评论 -
辗转相除法求最大共约数和最小公倍数
#include <stdio.h>int divisor,denominator;int fun1(int x,int y){ if(x<y) { x+=y; y=x-y; x=x-y; } if(x%y) divisor=fun1(y,x%y); else return divisor=y;}void fun2(int x,int y){...原创 2019-04-09 12:43:41 · 155 阅读 · 0 评论 -
链表递归反序输出
//键盘输入一个字符,每一个字符存放在一个链表节点,按反序把这行字符打印出来#include<stdio.h>#include<stdlib.h>#define LEN sizeof(Member)typedef struct member{ char ch; struct member *next;}Member;Member *creat(){ ...原创 2019-06-22 11:34:15 · 692 阅读 · 0 评论 -
dev调用函数可以少写一个参数
#include<stdio.h>int swap(char *a,char *b,int n=0) //当调用这个函数不给n赋值就不换,给n赋值就换 { if(n) { char c=*a; *a=*b; *b=c; } }int main(){ char ch1='a',ch2='b'; swap(&ch1,&ch2,...原创 2019-06-23 11:19:40 · 434 阅读 · 0 评论 -
链表与排序的结合
// 为足球队员建立记录,要有姓名、所属俱乐部、身高、年龄、按身高降序排列输出,再按年龄降序排列输出#include<stdio.h>#include<stdlib.h>#define LEN sizeof(struct player)typedef struct player{ char name[10]; char club[10]; float hei...原创 2019-06-24 02:26:30 · 166 阅读 · 0 评论