题解列表

筛选

程序员爬楼梯 (C语言代码)

摘要:解题思路:f(n) =    1, (n = 1, 2)    2, (n = 3)    f(n - 1) + f(n - 3), (n > 3)直接打表。参考代码:#include<stdio.h……

数据结构-稀疏矩阵转置 (C语言代码)

摘要:解题思路:    练习一下快速转置,只遍历三元组表一次,根据辅助数组确定入表位置。注意事项:    辅助数组的生成:遍历一次三元组表,记录原矩阵每列非0元素的个数,即可知道转置后每行非0元素个数和起始……

P1022 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <math.h>int main() { long long int n; scanf("%lld", &n); i……

P1021 (C语言代码)

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <math.h>int main() { int n; scanf("%d", &n); long long int……