如何用for循环出8X+6y+4z =200 200昆虫腿 ,蜘蛛 、蜻蜓、青蛙 各有多少只 满足这个情况
答案:1 悬赏:30 手机版
解决时间 2021-11-20 03:35
- 提问者网友:骨子里的高雅
- 2021-11-19 23:54
如何用for循环出8X+6y+4z =200 200昆虫腿 ,蜘蛛 、蜻蜓、青蛙 各有多少只 满足这个情况
最佳答案
- 五星知识达人网友:毛毛
- 2021-11-20 01:03
4x+6y+z=200可以表示三维空间的一个平面;如果x y z均是正整数的话,可以编程算一下:程序(C语言): #include main() {int x,y,z; for(x=0;x<=50;x++) {for(y=0;y<=34;y++) {for(z=0;z<=200;z++) {if(4*x+6*y+z==200) printf("x=%d,y=%d,z=%d\n",x,y,z);} } } } 结果: x=21,y=11,z=50 x=21,y=12,z=44 x=21,y=13,z=38 x=21,y=14,z=32 x=21,y=15,z=26 x=21,y=16,z=20 x=21,y=17,z=14 x=21,y=18,z=8 x=21,y=19,z=2 x=22,y=0,z=112 x=22,y=1,z=106 x=22,y=2,z=100 x=22,y=3,z=94 x=22,y=4,z=88 x=22,y=5,z=82 x=22,y=6,z=76 x=22,y=7,z=70 x=22,y=8,z=64 x=22,y=9,z=58 x=22,y=10,z=52 x=22,y=11,z=46 x=22,y=12,z=40 x=22,y=13,z=34 x=22,y=14,z=28 x=22,y=15,z=22 x=22,y=16,z=16 x=22,y=17,z=10 x=22,y=18,z=4 x=23,y=0,z=108 x=23,y=1,z=102 x=23,y=2,z=96 x=23,y=3,z=90 x=23,y=4,z=84 x=23,y=5,z=78 x=23,y=6,z=72 x=23,y=7,z=66 x=23,y=8,z=60 x=23,y=9,z=54 x=23,y=10,z=48 x=23,y=11,z=42 x=23,y=12,z=36 x=23,y=13,z=30 x=23,y=14,z=24 x=23,y=15,z=18 x=23,y=16,z=12 x=23,y=17,z=6 x=23,y=18,z=0 x=24,y=0,z=104 x=24,y=1,z=98 x=24,y=2,z=92 x=24,y=3,z=86 x=24,y=4,z=80 x=24,y=5,z=74 x=24,y=6,z=68 x=24,y=7,z=62 x=24,y=8,z=56 x=24,y=9,z=50 x=24,y=10,z=44 x=24,y=11,z=38 x=24,y=12,z=32 x=24,y=13,z=26 x=24,y=14,z=20 x=24,y=15,z=14 x=24,y=16,z=8 x=24,y=17,z=2 x=25,y=0,z=100 x=25,y=1,z=94 x=25,y=2,z=88 x=25,y=3,z=82 x=25,y=4,z=76 x=25,y=5,z=70 x=25,y=6,z=64 x=25,y=7,z=58 x=25,y=8,z=52 x=25,y=9,z=46 x=25,y=10,z=40 x=25,y=11,z=34 x=25,y=12,z=28 x=25,y=13,z=22 x=25,y=14,z=16 x=25,y=15,z=10 x=25,y=16,z=4 x=26,y=0,z=96 x=26,y=1,z=90 x=26,y=2,z=84 x=26,y=3,z=78 x=26,y=4,z=72 x=26,y=5,z=66 x=26,y=6,z=60 x=26,y=7,z=54 x=26,y=8,z=48 x=26,y=9,z=42 x=26,y=10,z=36 x=26,y=11,z=30 x=26,y=12,z=24 x=26,y=13,z=18 x=26,y=14,z=12 x=26,y=15,z=6 x=26,y=16,z=0 x=27,y=0,z=92 x=27,y=1,z=86 x=27,y=2,z=80 x=27,y=3,z=74 x=27,y=4,z=68 x=27,y=5,z=62 x=27,y=6,z=56 x=27,y=7,z=50 x=27,y=8,z=44 x=27,y=9,z=38 x=27,y=10,z=32 x=27,y=11,z=26 x=27,y=12,z=20 x=27,y=13,z=14 x=27,y=14,z=8 x=27,y=15,z=2 x=28,y=0,z=88 x=28,y=1,z=82 x=28,y=2,z=76 x=28,y=3,z=70 x=28,y=4,z=64 x=28,y=5,z=58 x=28,y=6,z=52 x=28,y=7,z=46 x=28,y=8,z=40 x=28,y=9,z=34 x=28,y=10,z=28 x=28,y=11,z=22 x=28,y=12,z=16 x=28,y=13,z=10 x=28,y=14,z=4 x=29,y=0,z=84 x=29,y=1,z=78 x=29,y=2,z=72 x=29,y=3,z=66 x=29,y=4,z=60 x=29,y=5,z=54 x=29,y=6,z=48 x=29,y=7,z=42 x=29,y=8,z=36 x=29,y=9,z=30 x=29,y=10,z=24 x=29,y=11,z=18 x=29,y=12,z=12 x=29,y=13,z=6 x=29,y=14,z=0 x=30,y=0,z=80 x=30,y=1,z=74 x=30,y=2,z=68 x=30,y=3,z=62 x=30,y=4,z=56 x=30,y=5,z=50 x=30,y=6,z=44 x=30,y=7,z=38 x=30,y=8,z=32 x=30,y=9,z=26 x=30,y=10,z=20 x=30,y=11,z=14 x=30,y=12,z=8 x=30,y=13,z=2 x=31,y=0,z=76 x=31,y=1,z=70 x=31,y=2,z=64 x=31,y=3,z=58 x=31,y=4,z=52 x=31,y=5,z=46 x=31,y=6,z=40 x=31,y=7,z=34 x=31,y=8,z=28 x=31,y=9,z=22 x=31,y=10,z=16 x=31,y=11,z=10 x=31,y=12,z=4 x=32,y=0,z=72 x=32,y=1,z=66 x=32,y=2,z=60 x=32,y=3,z=54 x=32,y=4,z=48 x=32,y=5,z=42 x=32,y=6,z=36 x=32,y=7,z=30 x=32,y=8,z=24 x=32,y=9,z=18 x=32,y=10,z=12 x=32,y=11,z=6 x=32,y=12,z=0 x=33,y=0,z=68 x=33,y=1,z=62 x=33,y=2,z=56 x=33,y=3,z=50 x=33,y=4,z=44 x=33,y=5,z=38 x=33,y=6,z=32 x=33,y=7,z=26 x=33,y=8,z=20 x=33,y=9,z=14 x=33,y=10,z=8 x=33,y=11,z=2 x=34,y=0,z=64 x=34,y=1,z=58 x=34,y=2,z=52 x=34,y=3,z=46 x=34,y=4,z=40 x=34,y=5,z=34 x=34,y=6,z=28 x=34,y=7,z=22 x=34,y=8,z=16 x=34,y=9,z=10 x=34,y=10,z=4 x=35,y=0,z=60 x=35,y=1,z=54 x=35,y=2,z=48 x=35,y=3,z=42 x=35,y=4,z=36 x=35,y=5,z=30 x=35,y=6,z=24 x=35,y=7,z=18 x=35,y=8,z=12 x=35,y=9,z=6 x=35,y=10,z=0 x=36,y=0,z=56 x=36,y=1,z=50 x=36,y=2,z=44 x=36,y=3,z=38 x=36,y=4,z=32 x=36,y=5,z=26 x=36,y=6,z=20 x=36,y=7,z=14 x=36,y=8,z=8 x=36,y=9,z=2 x=37,y=0,z=52 x=37,y=1,z=46 x=37,y=2,z=40 x=37,y=3,z=34 x=37,y=4,z=28 x=37,y=5,z=22 x=37,y=6,z=16 x=37,y=7,z=10 x=37,y=8,z=4 x=38,y=0,z=48 x=38,y=1,z=42 x=38,y=2,z=36 x=38,y=3,z=30 x=38,y=4,z=24 x=38,y=5,z=18 x=38,y=6,z=12 x=38,y=7,z=6 x=38,y=8,z=0 x=39,y=0,z=44 x=39,y=1,z=38 x=39,y=2,z=32 x=39,y=3,z=26 x=39,y=4,z=20 x=39,y=5,z=14 x=39,y=6,z=8 x=39,y=7,z=2 x=40,y=0,z=40 x=40,y=1,z=34 x=40,y=2,z=28 x=40,y=3,z=22 x=40,y=4,z=16 x=40,y=5,z=10 x=40,y=6,z=4 x=41,y=0,z=36 x=41,y=1,z=30 x=41,y=2,z=24 x=41,y=3,z=18 x=41,y=4,z=12 x=41,y=5,z=6 x=41,y=6,z=0 x=42,y=0,z=32 x=42,y=1,z=26 x=42,y=2,z=20 x=42,y=3,z=14 x=42,y=4,z=8 x=42,y=5,z=2 x=43,y=0,z=28 x=43,y=1,z=22 x=43,y=2,z=16 x=43,y=3,z=10 x=43,y=4,z=4 x=44,y=0,z=24 x=44,y=1,z=18 x=44,y=2,z=12 x=44,y=3,z=6 x=44,y=4,z=0 x=45,y=0,z=20 x=45,y=1,z=14 x=45,y=2,z=8 x=45,y=3,z=2 x=46,y=0,z=16 x=46,y=1,z=10 x=46,y=2,z=4 x=47,y=0,z=12 x=47,y=1,z=6 x=47,y=2,z=0 x=48,y=0,z=8 x=48,y=1,z=2 x=49,y=0,z=4 x=50,y=0,z=0
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯