题解 | #百钱买百鸡问题#

百钱买百鸡问题

http://www.nowcoder.com/practice/74c493f094304ea2bda37d0dc40dc85b

#include using namespace std;

int main() { int s; cin>>s; for(int i=0;i<20;i++) { for(int j=0;j<33;j++) { for(int n=0;n<100;n+=3) { if((5i+3j+n/3)==100&&(i+j+n==100)) { cout<<i<<" "<<j<<" "<<n<<endl; } } } } return 0; }

全部评论

相关推荐

02-18 13:28
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务