题解列表

筛选

C语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){    int n, m,i,j;    char name[11][21];……

第n小的质数(缩小循环)

摘要:参考代码: ```c #include #include int main() { int n; scanf("%d",&n); int a=2,k=0;//k是累计出现的质数 ……

C语言自由下落距离问题

摘要:解题思路:每次反弹上升的高度为下降的高度的一半,高度为M,则第N次反弹的高度为M=M/2;每一次落地后反弹,球的路程为x=M*3注意事项:第五次落地时的反弹上去的路程不用算上参考代码:#include……

带参数宏定义练习

摘要: import java.util.Scanner; public class Main { public static void main(String[] args) { S……

C语言解法容易理解

摘要:解题思路:找到规律转化为简易的数学语言参考代码:#include<stdio.h>int main(){    int a;    float b = 2;    int c = 1;    floa……

猴子吃桃简单for循环

摘要:解题思路:用数学方法反推发现每天猴子能吃的桃子数的规律,第一天为1个,记为x,第二天为(1+1)*2=4个,x的新值为4,第三天为(4+1)*2=10个,以此类推注意事项:参考代码#include<s……

自定义函数之数字分离

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int fun(char a[],char b[]){    int i=0,j=0;    whi……

2968: 区间内的真素数

摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int ss(int x){//判断是否为素数    if(x<2)    {       ……