利用数组指针解决问题 摘要:解题思路:双层循环,实现计数123123123;三个一次循环。利用取模i%n;注意事项:注意要让数组长度及时减去1参考代码:#include <stdio.h>#include <stdlib.h>/…… 题解列表 2024年01月31日 0 点赞 0 评论 175 浏览 评分:0.0
WB的解题思路 摘要:#include<stdio.h>int main(){ int n; scanf("%d",&n); int count=n; int arr[n]; int …… 题解列表 2024年03月10日 0 点赞 0 评论 220 浏览 评分:0.0
约瑟夫的环 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class wc {static Scanner sc=new Scanner(System.in);pu…… 题解列表 2024年03月17日 0 点赞 0 评论 289 浏览 评分:0.0
C语言改版001 摘要:#include<stdio.h>#include<stdlib.h>typedef struct student{ int number; struct student*next;}no…… 题解列表 2024年03月19日 0 点赞 0 评论 225 浏览 评分:0.0
1047 报数问题(一维数组遍历求解) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; scanf("%d",&n); int a[n+2]; for(int i=1;i<=n;i++)…… 题解列表 2024年05月22日 0 点赞 0 评论 191 浏览 评分:0.0
成了,经典的约瑟夫环问题 有n人围成一圈,顺序排号。从第1个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来的第几号的那位。 摘要:解题思路:建立c++的list容器,将数据输入,每搁三个判断一下,删除,继续判断,最后找到剩余的元素,输出注意事项:本次使用,学到了auto的新用法 参考代码:#include<iostream> …… 题解列表 2024年06月27日 0 点赞 0 评论 263 浏览 评分:0.0
借鉴大神的写法:写出自己的理解1047: [编程入门]报数问题 摘要:解题思路:看到大神写的不禁感叹! 我也是借鉴来的 首先我们要把题目搞清楚,将各个对象用C++的语言描述 n个人,首先应该想到 题解列表 2024年09月13日 0 点赞 0 评论 273 浏览 评分:0.0
只需调用<iostream>!用数组来依次报数。 摘要:解题思路:假设最开始有n个人在报数,因此定义一个储存n个数字的数组。用嵌套循环依次访问每个元素,每访问一次,cou就+1,当cou为3的倍数时,把该元素变成0(即该玩家出局)。每当所有元素都访问一遍后…… 题解列表 2024年10月28日 0 点赞 0 评论 292 浏览 评分:0.0
c语言简单数组解报数问题 摘要:解题思路:注意事项:参考代码:#includeint main(){ int arr[201]; int n,i,j; scanf ("%d",&n); for (i=0;i<n;i++) //…… 题解列表 2024年11月11日 0 点赞 0 评论 183 浏览 评分:0.0
一定要细心啊(不难) 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main(void) { int n; printf("Please enter the number…… 题解列表 2024年12月28日 1 点赞 0 评论 343 浏览 评分:0.0