题解 | #百钱买百鸡问题#
百钱买百鸡问题
https://www.nowcoder.com/practice/74c493f094304ea2bda37d0dc40dc85b
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a,b,c=0; for(int i=0; i<=100; i++){ for(int j=0; j<=100; j++){ for(int k=0; k<=100; k++){ if(k%3==0){ if(i*5+j*3+k/3==100&&i+j+k==100) cout << i << " " << j << " " << k << " " << endl; } } } } return 0; } // 64 位输出请用 printf("%lld")