Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
47217 | yuzhengxun | 练39.4 百钱买百鸡 | C++ | Wrong Answer | 1 MS | 248 KB | 489 | 2024-05-12 18:56:57 |
#include<bits/stdc++.h> using namespace std; int main() { int g,m,x; cout<<std::left<<setw(5)<<"公鸡"; cout<<std::left<<setw(5)<<"母鸡"; cout<<std::left<<setw(5)<<"小鸡"; for(int i=1;i<=100/3;i++){ for(int j=1;j<=100-i;j++){ for(int k=1;k<=100-i-j;k++){ if((i+j+k)==100&&(i*3+j*2+k/3)==100&&k%3==0){ cout<<std::left<<setw(5)<<i; cout<<std::left<<setw(5)<<j; cout<<std::left<<setw(5)<<k<<endl; } } } } return 0; }