f0216.cpp
Upload User: puke2000
Upload Date: 2022-07-25
Package Size: 912k
Code Size: 0k
Category:

CSharp

Development Platform:

Visual C++

  1. //=====================================
  2. // f0216.cpp
  3. // 百钱买百鸡
  4. //=====================================
  5. #include<iostream>
  6. using namespace std;
  7. //-------------------------------------
  8. int main(){
  9.   for(int cock=1; cock<=13; ++cock)
  10.   for(int hen=1; hen<=18; ++hen)
  11.     if((100-cock-hen)%3==0 && 7*cock+5*hen+(100-cock-hen)/3==100)
  12.       cout<<"cock:"<<cock<<", hen:"<<hen<<", chick:"<<100-cock-hen<<endl;
  13. }//====================================
  14.