有n个人围成一圈,顺序排号。从第一个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号位置
/******************************************************
E8.5
Plan:可以不循环喊1到3,用总数是不是3的倍数代替
CREATE----------------------------
By: Idooi Liu
Time: 2015/10/15-1500
----------------------------------
******************************************************/
#include
#include
int expThree(int n, int manArray[]);
int main(void)
{
int nMan; //How many people
char *pMan; //The array
int siteLast; //The last person's site
int i;
printf("Please input how many people:\n");
scanf("%d", &nMan);
pMan=malloc(nMan*sizeof(char));
//Assignment
for(i=0; i