unravel完整吉他谱:1-1993这1993个数,写在个圆圈上。之后把1擦掉留2和3。擦掉4留5和6...类推下去。求最后剩的一个数?
来源:百度文库 编辑:神马品牌网 时间:2024/10/04 16:59:35
原题:有1-1993这1993个数,用顺时针循环写在一个圆圈里。之后把1擦掉、留下2和3。擦掉4,留下5和6......以此类推继续下去。问最后剩下的一个数是多少?
1992
1993之前能被3整除的是1992
之后1993被删除,所以是1992
不知道
用程序算出来是584,用循环链表实现的:
#include<stdio.h>
#include<stdlib.h>
struct node{
int x;
struct node *next;
};
int main()
{
int i;
struct node *head,*p,*q;
p=head=(struct node *)malloc(sizeof(struct node));
p->x=1;
p->next=NULL;
q=p;
for(i=2;i<1994;i++){
p=(struct node *)malloc(sizeof(struct node));
p->x=i;
q->next=p;
q=p;
}
q->next=head;
i=0;
p=head;
while(p!=q){
if(i==0){p=p->next;free(q->next);q->next=p;}
else {if(i==2)i=-1;q=p;p=p->next;}
i++;
}
printf("%d",p->x);
free(p);
}
好象最后应该剩下两个数?????????????
1-1993这1993个数,写在个圆圈上。之后把1擦掉留2和3。擦掉4留5和6...类推下去。求最后剩的一个数?
把1,2,3,4,5,6这6个数分别填入圆圈内,使每个大圆上四个数的和等于13。如图
如何写个1再用圆圈包住?
用CAD划一条直线,在上边有N个圆圈,怎么样才能迅速让这些圆圈平均分布在这条直线上?
用CAD划一条直线,在上边有N个圆圈,怎么样才能迅速让这些圆圈平均分布在这条直线上?
用CAD划一条直线,在上边有N个圆圈,怎么样才能迅速让这些圆圈平均分布在这条直线上?
将1-9这七个数分别填如9个圆圈中,使每条直线上的三个数之和相等
24个圆圈连线
36个圆圈连线
一筐鸡蛋不到100个,3个3个数,数完剩1个,5个5个数,数完剩1个,这筐鸡蛋最多有多少个?