//砝码称重
void main()
{
int w1=1,w2=2,w3=3,w4=5,w5=10,w6=20;
int n1=5,n2=3,n3=2,n4=2,n5=1,n6=1;
int sum=0,count=0;
for(int i=0;i<=n1;i++)
{
for(int j=0;j<=n2;j++)
{
for(int k=0;k<=n3;k++)
{
for(int q=0;q<=n4;q++)
{
for(int w=0;w<=n5;w++)
{
for(int e=0;e<=n6;e++)
{
count++;
sum=i*w1+j*w2+k*w3+q*w4+w*w5+e*w6;
printf("%d\n",sum);
}
}
}
}
}
}
printf("总共%d种",count);
}
砝码称重
最新推荐文章于 2023-04-04 23:42:21 发布