直接上代码

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>

int main()
{
	int flag[10];
	int board[10][10];
	int s;
	for(int i=0;i<10;i++)
	{
		memset(flag,1,sizeof(flag));
		for(int j=0;j<10;)
		{
			s = rand()%10;
			if(flag[s])
			{
				board[i][j] = s;
				flag[s] = 0;
				j++;
			}
			
		}
	}
	for(int i=0;i<10;i++)
	{
		for(int j=0;j<10;j++)
			printf(" %d",board[i][j]);
		printf("\n");
	}
	return 0;
} 

  

相关文章:

  • 2021-12-24
  • 2022-02-11
  • 2022-12-23
  • 2022-01-20
  • 2022-01-16
  • 2022-02-22
  • 2022-01-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2021-08-24
  • 2021-07-14
  • 2022-12-23
  • 2021-06-02
相关资源
相似解决方案