题解列表

筛选

编写题解 2789: 骑车与走路

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    int a;    scanf("%d",&a);    if((a/3.0+27+23)<(a/1.2)……

编写题解 2788: 晶晶赴约会

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){   int a;   scanf("%d",&a);   if(a==1||a==3||a==5)   prin……

[编程入门]链表合并

**核心思想是先将二者合并,再利用插入排序**##代码#include#includetypedefstructNode{doublestu_num;doublegrade;structNode*next;}Node,*Nodelist;//初始化一个指向头节点的指针l,并为头节点分配内存空间。

1084素数筛法

素数筛的主要是采用反向构造合数的方式,筛选出素数。如何构造合数?在大于1的数字中任取两个数a,b相乘得到C,此时C必为合数(因为c此时的因子必有:1,a,b,c。)算法思路:1)设定两个数组,一个用于标记遍历访问,另一个用于存储筛选出的素数。

两个嵌套for循环解法

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

编写题解 2777: 计算2的幂

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

等差数列末项计算

摘要:解题思路:   根据高中学过的等差数列的知识,求公差,带入公式即有思路注意事项:参考代码:#include<stdio.h>int main(){    int a,b,d,n,N;    scanf……

简洁版代码

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; const int N=110; int p[N]; int find(int x……