百马百担

package myjava;

public class BAIMABAIDAN {

    public static void main(String[] args) {
        // TODO 自动生成的方法存根
        
        for(int i = 1;i<100;i++)
        {
            for(int n= 1;n<100;n++)
            {
                for(int t = 1;t<100;t++)
                {
                    if(i+n+t ==100&&i*3+n*2+t/2==100){
                        System.out.println("输出大马,中马,小马为:"+i+"  "+n+"  "+t);
                    }
                }
            }
        
        
        
        
        
        }

    }

}

原文地址:https://www.cnblogs.com/Yue0327/p/5107814.html