题解列表

筛选

2种递归写法

摘要:解题思路: #include   <bits/stdc++.h>using   namespace std;int pd(int m){  if(m<=0) return 0;  if(m==1) r……

c语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    double score[10],aver = 0;    int i,sum=0;    for (i ……

查找最接近的元素-折半/二分查找

摘要:解题思路:折半/二分查找,必须采用顺序存储。在有序的数组中,取中间值作为比较对象,若给定值与中间记录的关键字相等,则查找成功;若给定值小于中间值记录的关键字,则在中间记录的左半区继续查找;若给定值大于……

2861-验证子串

摘要:解题思路:实际上本题用到了数据结构的思想,采用最传统的暴力法,不断的比较注意事项:参考代码:int main(){ char s1[201]; char s2[201]; int len1……

[竞赛入门]简单的a+b

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    int a=0,b=0;    while(~scanf("%d%d", &a, &b))   //下面有……

2848-基因相关性

摘要:解题思路:注意事项:如果本题采用gets()的输入方法,那么会一直报错,不清楚为什么。scanf()就不会报错。参考代码:#include<stdio.h> #include<string.h> ……

2868-最长最短单词

摘要:解题思路:注意事项:请各位朋友帮忙指正,测试的时候只有91分。参考代码:struct Test{ char s[105]; int n; }; int main(){ struct T……