已有 2453 人浏览分享
55
0
版主
#include<iostream> using namespace std; int main(){ int a=6,b=5,c=4,x; cin>>x; for(int s=x/c;s>=0;s--){ for(int w=x/b;w>=0;w--){ for(int l=x/b;l>=0;l--){ if(x==s*4+w*5+l*6){ cout<<l<<endl<<w<<endl<<s; return 0; } } } } }
1、转载或引用本网站内容须注明原网址,并标明本网站网址(www.sdzqd.com)。
2、转载或引用本网站中的署名文章,请按规定向原作者支付稿酬。
3、对于不当转载或引用本网站内容而引起的民事纷争、行政处理或其他损失,本网站不承担责任。
4、对不遵守本声明或其他违法、恶意使用本网站内容者,本网站保留追究其法律责任的权利。
唯一网址: https://abc.sdzqd.com/forum.php?mod=viewthread&tid=186
使用道具 举报
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
|手机版|小黑屋|山东智趣岛论坛 ( 鲁ICP备2023024048号 )
GMT+8, 2025-7-4 23:37 , Processed in 0.270381 second(s), 53 queries .
Powered by Discuz! X3.4 Licensed
Copyright © 2001-2020, Tencent Cloud.
客服电话
电子邮件
在线时间:8:00-16:00