1.百钱百鸡——解不定方程组
/*
问题描述:1只公鸡5钱,1只母鸡3钱,3只小鸡1钱,现有100钱要买100只鸡,改怎么买?
问题分析:设买公鸡cock只,母鸡Hen只,小鸡chicken只
列出如下不定方程:
cock+hen+chicken=100
5cock+3hen+chicken/3=100
解决方法:实质是解不定方程,使用穷举法
*/
#include <stdio.h>
int main()
{
int cock, hen, chicken;
for (cock = 0; cock <= 20; cock++)
{
for (hen = 0; hen <= 33; hen++)
{
for (chicken = 0; chicken <= 100; chicken++)