题解 | #百钱买百鸡问题#
百钱买百鸡问题
https://www.nowcoder.com/practice/74c493f094304ea2bda37d0dc40dc85b
/*
* @Description: If you get question about the code, contact me at **********.
* @Author: pengjunxing
* @Date: 2023-02-10 20:05:28
* @LastEditors: pengjunxing
* @LastEditTime: 2023-02-10 20:29:36
*/
#include<iostream>
using namespace std;
int main()
{
cin.get();
for(int i =0;i<=100;i++)
{
for(int j = 0;j<=100;j++)
{
for(double k =0;k<=100;k++)
{
double sum=i*5+j*3+k/3;
if((sum==100)&&(i+j+k)==100)
{
cout<<i<<" "<<j<<" "<<k<<endl;
}
}
}
}
}
