用指针和while循环解决报数问题 摘要:解题思路:不采取删除被淘汰者的方式,固定总人数,用0代表被淘汰,1代表未被淘汰。指针顺次指向每个人以模拟报数过程,当每轮次指针指向最后一人时,用while循环使其指回第一人。具体见代码注释。注意事项:…… 题解列表 2024年01月25日 0 点赞 0 评论 277 浏览 评分:0.0
表达式括号匹配(stack)-java版 摘要:解题思路:利用栈的基本操作解题,如发现简化思路和bug欢迎大佬指点注意事项:参考代码:import java.util.Scanner;public class Main { public sta…… 题解列表 2024年01月25日 0 点赞 0 评论 293 浏览 评分:0.0
暴力解题111 摘要:### #include #include using namespace std; const int N=1100; int A[N],B[N],C[N]; int main() {…… 题解列表 2024年01月25日 0 点赞 0 评论 219 浏览 评分:0.0
数字逆序输出 摘要:解题思路:1.具体问题具体分析,本题要求输入十个数,定义数组长度为10就行了。2.注意数组下标是从零开始的,最后一个下标为9;数组下标0123456789插入前1234567890插入后0987543…… 题解列表 2024年01月25日 0 点赞 0 评论 189 浏览 评分:9.9
1033: [编程入门]自定义函数之字符提取 摘要:解题思路:注意事项:参考代码:a=input()s=[]for i in a: if i=="a" or i=="e" or i=="i" or i=="o" or i=="u": …… 题解列表 2024年01月25日 0 点赞 0 评论 146 浏览 评分:0.0
编写题解 1013: [编程入门]Sn的公式求和(C语言) 摘要:参考代码:#include<stdio.h> int GetSn(int n){ int An[n]; // 变量数组不能直接初始化 int sum = 2; …… 题解列表 2024年01月25日 0 点赞 0 评论 112 浏览 评分:9.9
python解答,内容简洁易读 摘要:参考代码:def match_strings(s1, s2): i, j = 0, 0 while i < len(s1) and j < len(s2): if s1[i]…… 题解列表 2024年01月25日 0 点赞 0 评论 166 浏览 评分:0.0
编写题解 1047: [编程入门]报数问题(C语言) 摘要:参考代码:(C语言)#include<stdio.h> int main() { int n; // 人数 scanf("%d", &n); in…… 题解列表 2024年01月25日 0 点赞 0 评论 128 浏览 评分:9.9
第四届真题-带分数 摘要:解题思路:注意事项:参考代码:/*暴力思路: 1.枚举全排列 2.枚举a,b,c的每一位数,枚举其中两个即可。可以使用高中排列知识,在9位数中找2个空隙放隔板 3.判断等式是否成立*/ #in…… 题解列表 2024年01月25日 0 点赞 0 评论 239 浏览 评分:0.0
有规律的数列求和 摘要:参考代码:#include <stdio.h>#include <stdlib.h>float sum_dev(float fenzi,float fenmu,int n,float s){ if(n…… 题解列表 2024年01月25日 0 点赞 0 评论 398 浏览 评分:0.0