第29天打卡

问题:用1,2,3,4组成多少个不重复的3位数,分别是多少?

源代码:

#include<stdio.h>

int main()

{

int i,j,k,count=0;

printf("\n");

for(i=1;i<5;i++)

for(j=1;j<5;j++)

{

if(i!=k&&i!=j&&j!=k)

{

count++;printf("%d%d%d",i,j,k);

if(count%8==00

printf("\n");

}

printf("有%d个数",count);

printf("\n");

}

}

posted @ 2023-05-21 23:19  皮卡丘和杰尼龟  阅读(9)  评论(0)    收藏  举报