糖果游戏-环状数组的左右索引公式 摘要:解题思路:初始化数组,输入循环,左右索引的循环,按照索引同时更新数组,输出的循环。注意事项:cin的位置;索引的初始化(int left);环状数组的左右索引公式-左侧:(i-1+n)%n 右侧:(i…… 题解列表 2024年11月20日 1 点赞 0 评论 458 浏览 评分:10.0
3030: 全排列 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 全局变量声明 int l; // 字符串长度 string s; …… 题解列表 2024年11月20日 1 点赞 0 评论 595 浏览 评分:10.0
超容易理解的 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;void verse(int a){ int ret[100]; int count=0; w…… 题解列表 2024年11月20日 5 点赞 0 评论 1032 浏览 评分:10.0
小白练习运用递归来写等差数列求和 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int fab(int x){//递归算法if(x==1)//结束递归的条件return 3*x-1;elsereturn 3*x-1+…… 题解列表 2024年11月20日 0 点赞 0 评论 452 浏览 评分:10.0
简易链表求和 摘要:解题思路:注意事项:函数名是拼音,英语不好参考代码:#include <stdio.h>#include <stdlib.h>typedef struct node{ int s; int…… 题解列表 2024年11月21日 4 点赞 1 评论 635 浏览 评分:10.0
简短且简单 摘要:解题思路:1. 首先包含了 <stdio.h> 和 <string.h> 头文件,用于输入输出和字符串操作。2. 在 main 函数中,定义了一个字符数组 str 来存储输入的字符串,以及一个整数 f…… 题解列表 2024年11月21日 2 点赞 0 评论 924 浏览 评分:10.0
良心出品,放心食用 摘要:解题思路:这段代码定义了一个数组 A ,并通过循环计算出 N 在一定范围内(小于 55)时对应的某种数量值 A[N - 1] ,然后根据输入的 N 值输出相应的结果。在代码中,首先初始…… 题解列表 2024年11月21日 1 点赞 0 评论 376 浏览 评分:10.0
感觉你们应该可以看懂,有两种药方 摘要:解题思路:注意事项:参考代码://方法一:#include <stdio.h>#include<string.h> void q(char x[100],int y[4]){ int len=0; …… 题解列表 2024年11月22日 0 点赞 0 评论 811 浏览 评分:10.0
题解 2913: 整数去重 菜鸟解法 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int i,j,n; scanf("%d",&n); int a[n]; for(i=0…… 题解列表 2024年11月22日 2 点赞 0 评论 577 浏览 评分:10.0
定义一个长度为10的数组存放尾数0到9的最大长度来解决问题 摘要:解题思路:由于每个数只要头和尾,而其中尾只能是0到9,即使当尾为0时不能继续接,也要用10个参数来储存尾巴为0到9的最大长度即可。p[10]的1到9对应当前尾巴为1到9的长度最长的值,所以每拿到一个新…… 题解列表 2024年11月22日 8 点赞 0 评论 1162 浏览 评分:10.0