编写题解 1047: [编程入门]报数问题(python) 摘要:解题思路:注意事项:参考代码:n = int(input())l = [i for i in range(1,n+1)]while True: if len(l) >= 3: l.…… 题解列表 2021年11月19日 0 点赞 0 评论 305 浏览 评分:9.9
用函数加递归 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(){ int n; scanf("%d",&n); printf("%d",f(n)); r…… 题解列表 2021年11月23日 0 点赞 3 评论 224 浏览 评分:9.9
无链表基本操作破题 摘要:解题思路:我还不会链表所以就用基本的方法做了注意事项:防止代码卡死在循环内应及时加入判断条件跳出循环参考代码:#include <stdio.h>#include <string.h>int main…… 题解列表 2021年11月25日 0 点赞 0 评论 320 浏览 评分:9.9
循环链表解决约瑟夫环 摘要:解题思路:尾插法将链表串起来,使用两个指针删除应该删的节点那一个,一直循环至剩下最后一个。注意事项:参考代码:#include<stdio.h> #include<stdlib.h> struct…… 题解列表 2021年11月26日 0 点赞 0 评论 576 浏览 评分:9.9
1047: [编程入门]报数问题 摘要:import java.io.*; /** * 公式法直接解决。 */ public class Main { public static BufferedReader …… 题解列表 2021年12月11日 0 点赞 0 评论 620 浏览 评分:9.9
1047: 报数问题 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { public static void main(String[] args) {…… 题解列表 2022年01月13日 0 点赞 0 评论 698 浏览 评分:9.9
1047: [编程入门]报数问题(python:最简单易懂的方法,5行搞定) 摘要:解题思路:把号列成一个列表,每次报数去除3号相当于把列表的前两项移到列表最后,把3号后的列表加上前两项,循环报数,列表不断变短,当只剩两人第二个就是剩下的注意事项:参考代码:n = int(input…… 题解列表 2022年01月14日 0 点赞 3 评论 689 浏览 评分:9.9
不如链表好,太多判断, 摘要:#include<stdio.h> #include<string.h> #include<malloc.h> int main(){ int n; int status=sca…… 题解列表 2022年01月19日 0 点赞 0 评论 193 浏览 评分:9.9
约瑟夫环——循环链表 摘要:解题思路:注意事项:参考代码:#include<stdio.h> #include<stdlib.h> struct student { int num; struct st…… 题解列表 2022年01月19日 0 点赞 0 评论 219 浏览 评分:9.9
报数问题,公式解决 摘要:解题思路: 公式:f(n,3)=(f(n−1,3)+3)%n ,其中n是总人数,f(n,3)是获胜者的下标位置。注意事项: 这个公式计算的是从0开始的下标位置,所以最后还要加一。 …… 题解列表 2022年01月20日 0 点赞 0 评论 397 浏览 评分:9.9