摘要: 如果我每一步迈上1个或两个台阶,先迈左脚,然后左右交换,最后一步迈右脚,也就是一共要走偶数步, 那么,上完39级台阶,有多少种不同的算法 1 #include "stdio.h" 2 int total=0;//计数 3 int Sum(int num,int step) 4 { 5 if(num< 阅读全文
posted @ 2020-09-26 16:21 然终酒肆 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 其实用现成的c++ 库中的sort排序就可以完美解决 但是为了体会算法的本质 我还要敲一遍别的 问题描述 给定一个长度为n的数列,将这个数列按从小到大的顺序排列。 1<=n<=200 输入格式 第一行为一个整数n。 第二行包含n个整数,为待排序的数,每个整数的绝对值小于 10000。 输出格式 输出 阅读全文
posted @ 2020-09-26 15:45 然终酒肆 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int visit(int, int); 4 5 int maze[7][7] = 6 7 { 8 {2, 2, 2, 2, 2, 2, 2}, 9 {2, 0, 0, 0, 0, 0, 2}, 10 {2, 阅读全文
posted @ 2020-09-26 15:10 然终酒肆 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 1 #include "stdio.h" 2 #include "String.h" 3 #define MAX 10000 4 int f[MAX]; 5 void Arr_reset(int a[],int m,int n) 6 { 7 int i; 8 for(i=m;i<=m;i++) 9 阅读全文
posted @ 2020-09-26 14:53 然终酒肆 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 1.问题描述 1221是一个非常特殊的数,它从左边读和从右边读是一样的,编程求所有这样的四位十进制数。 输出格式 按从小到大的顺序输出满足条件的四位十进制数。 血马简单 但是还是要敲 1 #include"stdio.h" 2 int main(void) 3 { 4 int i,a,b,c,d; 阅读全文
posted @ 2020-09-26 14:26 然终酒肆 阅读(180) 评论(0) 推荐(0) 编辑