求不定方程X1+X2+X3+3X4+3X5+5X6=21的正整数解的组数

gloryking2010
2011-02-17 · TA获得超过922个赞
知道小有建树答主
回答量:417
采纳率:100%
帮助的人:254万
展开全部
解:因为是正整数解
所以:1<=x<=8
正整数解如下:
x1=1, x2=1, x3=2,x4 =1,x5=3,x6=1
x1=1, x2=1, x3=2,x4 =2,x5=2,x6=1
x1=1, x2=1, x3=2,x4 =3,x5=1,x6=1
x1=1, x2=1, x3=3,x4 =1,x5=1,x6=2
x1=1, x2=1, x3=5,x4 =1,x5=2,x6=1
x1=1, x2=1, x3=5,x4 =2,x5=1,x6=1
x1=1, x2=1, x3=8,x4 =1,x5=1,x6=1
x1=1, x2=2, x3=1,x4 =1,x5=3,x6=1
x1=1, x2=2, x3=1,x4 =2,x5=2,x6=1
x1=1, x2=2, x3=1,x4 =3,x5=1,x6=1
x1=1, x2=2, x3=2,x4 =1,x5=1,x6=2
x1=1, x2=2, x3=4,x4 =1,x5=2,x6=1
x1=1, x2=2, x3=4,x4 =2,x5=1,x6=1
x1=1, x2=2, x3=7,x4 =1,x5=1,x6=1
x1=1, x2=3, x3=1,x4 =1,x5=1,x6=2
x1=1, x2=3, x3=3,x4 =1,x5=2,x6=1
x1=1, x2=3, x3=3,x4 =2,x5=1,x6=1
x1=1, x2=3, x3=6,x4 =1,x5=1,x6=1
x1=1, x2=4, x3=2,x4 =1,x5=2,x6=1
x1=1, x2=4, x3=2,x4 =2,x5=1,x6=1
x1=1, x2=4, x3=5,x4 =1,x5=1,x6=1
x1=1, x2=5, x3=1,x4 =1,x5=2,x6=1
x1=1, x2=5, x3=1,x4 =2,x5=1,x6=1
x1=1, x2=5, x3=4,x4 =1,x5=1,x6=1
x1=1, x2=6, x3=3,x4 =1,x5=1,x6=1
x1=1, x2=7, x3=2,x4 =1,x5=1,x6=1
x1=1, x2=8, x3=1,x4 =1,x5=1,x6=1
x1=2, x2=1, x3=1,x4 =1,x5=3,x6=1
x1=2, x2=1, x3=1,x4 =2,x5=2,x6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1
x1=4, x2=1, x3=5,x4 =1,x5=1,x6=1
x1=4, x2=2, x3=1,x4 =1,x5=2,x6=1
x1=4, x2=2, x3=1,x4 =2,x5=1,x6=1
x1=4, x2=2, x3=4,x4 =1,x5=1,x6=1
x1=4, x2=3, x3=3,x4 =1,x5=1,x6=1
x1=4, x2=4, x3=2,x4 =1,x5=1,x6=1
x1=4, x2=5, x3=1,x4 =1,x5=1,x6=1
x1=5, x2=1, x3=1,x4 =1,x5=2,x6=1
x1=5, x2=1, x3=1,x4 =2,x5=1,x6=1
x1=5, x2=1, x3=4,x4 =1,x5=1,x6=1
x1=5, x2=2, x3=3,x4 =1,x5=1,x6=1
x1=5, x2=3, x3=2,x4 =1,x5=1,x6=1
x1=5, x2=4, x3=1,x4 =1,x5=1,x6=1
x1=6, x2=1, x3=3,x4 =1,x5=1,x6=1
x1=6, x2=2, x3=2,x4 =1,x5=1,x6=1
x1=6, x2=3, x3=1,x4 =1,x5=1,x6=1
x1=7, x2=1, x3=2,x4 =1,x5=1,x6=1
x1=7, x2=2, x3=1,x4 =1,x5=1,x6=1
x1=8, x2=1, x3=1,x4 =1,x5=1,x6=1
符合条件的解有:81组

程序如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int k = 0;
for (int x1 = 1; x1 <= 8; x1 ++)
{
for (int x2 = 1; x2 <=8; x2++)
{
for (int x3 = 1; x3 <=8; x3++)
{
for (int x4 = 1; x4 <=8; x4++)
{
for (int x5 = 1; x5 <=8; x5++)
{
for (int x6 = 1; x6 <= 8; x6++)
{
if(x1+x2+x3+3*x4+3*x5+5*x6==21)
{
System.Console.WriteLine("x1={0}, x2={1}, x3={2},x4 ={3},x5={4},x6={5}",x1, x2, x3,x4,x5,x6);
k++;
}
}
}
}
}
}
}
System.Console.WriteLine("符合条件的解有:{0}组",k);
System.Console.ReadKey();
}
}
}
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式