百钱百鸡

来源:互联网 发布:笑笑淘宝店 编辑:程序博客网 时间:2024/06/11 23:48

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 百钱百鸡
{
    class Program
    {
        static void Main(string[] args)
        {
            int z = 0;
            int y = 0;
            int x = 0;
            for (x = 0; x <= 20; x++)
            {
                for (y = 0; y <= 100 - x; y++)
                {
                    {
                        for (z = 0; z <= 100 - x - y; z++)
                        {
                            if ((x + y + z == 100))
                            {
                                if ((5 * x + 3 * y + z / 3) == 100)
                                {
                                    if (z % 3 ==100)
                                    {
                                    }
                                    Console.WriteLine("公鸡数量"+x + " " +"母鸡数量"+ y + " " +"小鸡数量"+z);
                                    Console.ReadLine();
                                }
                            }

原创粉丝点击