{ "question_id": 159655, "question_title": "买蛋", "question_content": "100元怎么买100个蛋,鸡蛋1毛一个,鸭蛋3元一个,鹅蛋6元一个", "difficulty": "简单", "answer_id": 25451, "answer_content": "```\n public class Egg{\n\tpublic static void main(String[] args){\n\t\tint chicken=0,duck=0,goose=0;\n\t\tfor(int i=0;i<100;i++){\n\t\t\tchicken = i;\n\t\t\t\tfor(int j=0;j<100;j++){\n\t\t\t\t\tduck = j;\n\t\t\t\t\tgoose = 100-duck-chicken;\n\t\t\t\t\tif(chicken+duck*30+goose*60==1000&&chicken>0&&duck>0&&goose>0){\t\n\t\t\t\t\t\tSystem.out.println(\"鸡:\"+chicken+\" 鸭:\"+duck+\" 鹅:\"+goose);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t}\t\t\t\t\n\t}\t\n}\n```\n\n", "tag_name": "java", "java": "public class Egg {\n\tpublic static void main(String[] args) {\n\t\tint chicken = 0, duck = 0, goose = 0;\n\t\tfor (int i = 0; i < 100; i++) {\n\t\t\tchicken = i;\n\t\t\tfor (int j = 0; j < 100; j++) {\n\t\t\t\tduck = j;\n\t\t\t\tgoose = 100 - duck - chicken;\n\t\t\t\tif (chicken + duck * 30 + goose * 60 == 1000 && chicken > 0 && duck > 0 && goose > 0) {\n\t\t\t\t\tSystem.out.println(\"鸡:\" + chicken + \" 鸭:\" + duck + \" 鹅:\" + goose);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "topic_link": "https://bbs.csdn.net/topics/600469876", "status": 1, "keywords": "算法", "license": "csdn.net", "notebook": { "java": "https://codechina.csdn.net/csdn/csdn-daily-code/-/jupyter/master/data/notebook/answer/ipynb/java/23.ipynb?type=file" }, "notebook_enable": 1 }