摘要: 用辗转相处法求最大公约数 最小公倍数为两数的乘积除以两数的最小公倍数 代码如下: 1 //最大公约数和最小公倍数 2 # include<stdio.h> 3 int a,b; 4 int main() 5 { 6 scanf("%d%d",&a,&b); 7 int yue(int,int); 8 阅读全文
posted @ 2020-03-09 12:27 kakusan 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 代码如下: 1 //返回结构体的函数 2 #include<stdio.h> 3 float a[10]; 4 struct b 5 { 6 float sum; 7 float max; 8 float min; 9 }; 10 b B; 11 b Select(float a[],int); 1 阅读全文
posted @ 2020-03-08 15:27 kakusan 阅读(2214) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 float a[10]; 3 void Select(float a[],int); 4 int main() 5 { 6 for(int i=0;i<10;i++) scanf("%f",&a[i]); 7 Select(a,10); 8 for(i=0 阅读全文
posted @ 2020-03-07 21:08 kakusan 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 问题描述:有三个塔座,A塔座有n大小不同的盘子,B,C塔座为空。 要A塔上的盘子按原状借助C塔移到B塔,每次移动一个盘子,且在移 动过程中,小盘子不能置于大盘子之下 代码如下: 1 # include<stdio.h> 2 int n; 3 char a='A',b='B',c='C'; 4 voi 阅读全文
posted @ 2020-03-07 17:53 kakusan 阅读(157) 评论(0) 推荐(0) 编辑
摘要: //自定义strcpy函数 # include<stdio.h> char c[50]={0}; char b[50]={0}; void strcpy1(char *a,char *b); int main() { gets(c); gets(b); strcpy1(c,b); puts(c); 阅读全文
posted @ 2020-03-06 23:37 kakusan 阅读(465) 评论(0) 推荐(0) 编辑
摘要: //比较字符串,输出首个不同字符的差值 # include<stdio.h> char c[50]={0}; char b[50]={0}; int strcmp1(char *a,char *b); int main() { gets(c); gets(b); printf("%d\n",strc 阅读全文
posted @ 2020-03-06 23:16 kakusan 阅读(578) 评论(0) 推荐(0) 编辑
摘要: //不用strcat函数连接字符串 # include<stdio.h> char c[50]={0}; char b[15]={0}; void strcat1(char *a,char *b); int main() { gets(c); gets(b); strcat1(c,b); puts( 阅读全文
posted @ 2020-03-06 22:48 kakusan 阅读(613) 评论(0) 推荐(0) 编辑
摘要: 密码转换原则 26个字母里面,第i个字母的米码为第26-i+1个字母 //密码问题 第i个大写或者小写字母的密码为第26-i+1个对应字母 # include<stdio.h> char c[150]; char m[150]={0}; int main() { gets(c); for(int i 阅读全文
posted @ 2020-03-06 22:19 kakusan 阅读(268) 评论(0) 推荐(0) 编辑
摘要: # include<stdio.h> char c[3][81]; int upp,low,sp,num,oth; int main() { upp=low=sp=num=oth=0; printf("请输入:\n"); for(int i=0;i<3;i++) gets(c[i]); printf 阅读全文
posted @ 2020-03-06 18:25 kakusan 阅读(182) 评论(0) 推荐(0) 编辑
摘要: //找二维数组鞍点 # include<stdio.h> float a[10][10]; int maxrow[10]; int mincol[10]; int n; int main() { printf("请输入n:"); scanf("%d",&n); printf("请输入%d阶矩阵:", 阅读全文
posted @ 2020-03-06 17:15 kakusan 阅读(727) 评论(0) 推荐(0) 编辑