山东智趣岛论坛

 找回密码
 立即注册
查看: 9751|回复: 0
打印 上一主题 下一主题

百钱买百鸡

[复制链接]
跳转到指定楼层
楼主
发表于 2024-6-22 17:24:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#include<bits/stdc++.h>
using namespace std;
int main(){
        float gong,mu,xiao;
        for(float gong=0;gong<=20;gong++){
                for(float mu=0;mu<=33;mu++){
                        xiao=100-gong-mu;
                        if(int(xiao)==xiao){
                        if((gong*5+mu*3+xiao/3)==100){
                                cout<<gong<<" "<<mu<<" "<<xiao<<endl;
                        }
                        }
                }
               
        }
}

回复

使用道具 举报

QQ|山东智趣岛论坛 ( 鲁ICP备2023024048号 )

GMT+8, 2025-3-1 06:50 , Processed in 0.167603 second(s), 37 queries .

Powered by Discuz! X3.3 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表