题解列表

筛选

冒泡排序思想,直接比较大小

摘要:解题思路:使用冒泡排序思想,直接用strcmp()函数比较字符串大小即可参考代码:#include<stdio.h> #include<string.h> int main(){ char a……

温度转换题目

摘要:解题思路:注意事项:注意数据类型,f,c是双精度温度,输出为长浮点数型。参考代码:#include<stdio.h>int main(){    double f,c;    scanf("%lf",……

题目 1177: 三角形(动态规划)

解题思路:题目可能有问题,每一步只能由当前位置向左下或右下,而是每一步只能由当前位置向正下下或右下。注意事项:因此可以写出动态规划的函数:dp[i][j]=max(dp[i-1][j-1],dp[i-1][j])+a[i][j];参考代码:#includeusingnam

编写题解 2966: 最大质因子序列

摘要:解题思路:先找因数,在判断是不是质数。注意事项:参考代码:#include <stdio.h>#include <math.h>int yinshu(int c){ for (int i = 1; i……

The 3n + 1 problem

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include<math.h>int main(){ int a,b; int i = 0; int x; while (scan……

简单易懂的解题思路

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    int n,i,a[1000],x,y,k;    scanf("%d",&n);    for(i=0;……