题解列表

筛选

数据结构-字符串插入

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){    int i;    int t=0;    int j=0;    c……

辗转相除法

摘要:解题思路:辗转相除法,最小公因数用数学表示为: gcd(a, b) = gcd(b, a mod b)。最大公倍数为两数的积除以最小公因数。注意事项:因为我这里gcd函数的第一个输入值设置为较小的值,……

完数的判断

摘要:#include <stdio.h> int main(){ int sum=1, i=2,y=2,N=0; scanf("%d",&N); for(i;i<=N;i++){ su……

有规律的数列求和

摘要:#include <stdio.h> int main(){ int N=10,i; float x=2.0,y=1.0,z=0.0,sum=2.0; //scanf("%d",&N);……

平均值的计算

摘要:解题思路:注意事项:参考代码:import java.util.Scanner;    public class Main {        public static void main(Strin……

哇靠送分题

摘要:解题思路:注意事项:小小的改一下题目参考代码:#include<iostream>using namespace std;int main(){    int a,b,c;    while(cin>……

哇靠送分题*2

摘要:解题思路:思考注意事项:参考代码:#include<iostream>using namespace std;int main(){    int a,b,c;    while(cin>>a>>b>……

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 ……

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

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