55
265
版主
#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; } } } } }
使用道具 举报
|山东智趣岛论坛 ( 鲁ICP备2023024048号 )
GMT+8, 2025-3-1 12:34 , Processed in 0.194886 second(s), 35 queries .
Powered by Discuz! X3.3 Licensed
Copyright © 2001-2020, Tencent Cloud.