1百钱买白鸡
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n;
signed main()
{
for(int i=0;i<=20;i++)//5钱的鸡
{
for(int j=0;j<=33;j++)//三钱的鸡
{
for(int k=0;k<=100;k++)
{
if(i+k+j==100&&5*i+3*j+k/3==100)//满足100钱和100鸡
cout<<i<<' '<<j<<' '<<k<<endl;
}
}
}
}
流程图
标签:std,int,long,白鸡,打卡,100 From: https://www.cnblogs.com/litianyu1969/p/17305859.html