其他分享
首页 > 其他分享> > 百钱百鸡·

百钱百鸡·

作者:互联网

public class Demo {
    public static void main(String[] args) {


         for (int x=0 ;x<=20;x++)
         {
             for (int y=0 ;y<=33;y++)
             {
                 int z=100-x-y;

                 if ( z%3==0 && 5*x+3*y+z/3==100)
                 {
                     System.out.println(x+","+y+","+z);

                 }
             }
         }

        }

    }





输出结果:
0,25,75
4,18,78
8,11,81
12,4,84

标签:int,百钱,System,static,百鸡,100,81,public
来源: https://blog.csdn.net/qq_53835915/article/details/119464114