⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lind_t1.c

📁 谭浩强第二版的课后习题的答案的源程序
💻 C
字号:
#include<stdio.h>
void main()
{
	int a[100]={0};
	int i,j,m,n,t;

	printf("Please input n&m.\nn presents the number of the people,\nm presents the number of people who should stand out.\n");
	scanf("%d%d",&n,&m);

	for(i=0,j=0;j<m*n;i++)
	{
		t=i;
		if(a[i]==0)
		j++;
		if(i==n-1)
		{
			i=-1;
		}
		if(j%m==0&&a[t]==0)
		{
			printf("%d ",t+1);
			a[t]=1;
		}
	}
	printf("\n\n");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -