题目:
答案:
#include<stdio.h>
int main()
{
int n = 0;
int i = 0, j = 0, k = 0; //i变量用来控制百位数,j用来控制十位数,k用来控制个位数
int count = 0; //count用来控制一行只能有六个数字
scanf("%d", &n);
for (i = n; i <= n + 3; i++) //百位数i从2-5依次循环
{
for (j = n; j <= n + 3; j++) //十位数j依次从2-5循环
{
for (k = n; k <= n + 3; k++) //个位数k依次从2-5进行循环
{
if (i != j && j != k && i != k) //循环的过程中只要三位数不重复就满足