题解 1047: [编程入门]报数问题

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

C语言改版001

摘要:#include<stdio.h>#include<stdlib.h>typedef struct student{    int number;    struct student*next;}no……

WB的解题思路

摘要:#include<stdio.h>int main(){        int n;    scanf("%d",&n);    int count=n;    int arr[n];    int ……

利用数组指针解决问题

摘要:解题思路:双层循环,实现计数123123123;三个一次循环。利用取模i%n;注意事项:注意要让数组长度及时减去1参考代码:#include <stdio.h>#include <stdlib.h>/……

用指针和while循环解决报数问题

解题思路:不采取删除被淘汰者的方式,固定总人数,用0代表被淘汰,1代表未被淘汰。指针顺次指向每个人以模拟报数过程,当每轮次指针指向最后一人时,用while循环使其指回第一人。具体见代码注释。注意事项:参考代码:#include#include#include

报数问题,C语言,简单语法,不用数学模型

摘要:解题思路://我的思路: //第一个人赋1,第二赋2,最后一人直接问是多少就是几号 //可以利用余数来创造一个既在增加的又在循环的数组//再利用contiune模拟被踢出圈子//再用m%3==0来踢人……

报数问题。。。记录一下

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ char a[100]={0}; int i=0,k=0,n; scanf("%d",&n); int coun……

C语言简单思路的代码

摘要:解题思路:根据n与3的关系来做注意事项:参考代码:int main(){ int n,late; scanf("%d", &n); int a[1000]; for (int i = 0; i < n……

通过数组标记

摘要:解题思路:用数组给每个人标号,将每次循环报3的人赋值0,直到只剩1个找到它的标号。参考代码:#include <stdio.h>// 函数pan用于找出最后剩下的一个元素int pan(int *a,……