
枚举
sunshine_lyn
欢迎访问个人博客: https://www.elainelv.github.io/
展开
-
九度OJ 1036:Old Bill
题目描述: Among grandfather's papers a bill was found. 72 turkeys $_679_ The first and the last digits of the number that obviously represented the total price of those turkeys are replaced here ...原创 2018-03-04 15:26:56 · 248 阅读 · 0 评论 -
九度OJ1059 abc(枚举)
题目描述:设a、b、c均是0到9之间的数字,abc、bcc是两个三位数,且有:abc+bcc=532。求满足条件的所有a、b、c的值。输入:题目没有任何输入。输出:请输出所有满足题目条件的a、b、c的值。a、b、c之间用空格隔开。每个输出占一行。思路:枚举#include<stdio.h> #include<string.h> int main() { int ...原创 2018-03-04 15:01:23 · 296 阅读 · 0 评论 -
九度OJ 1045:百鸡问题
题目描述: 用小于等于n元去买100只鸡,大鸡5元/只,小鸡3元/只,还有1/3元每只的一种小鸡,分别记为x只,y只,z只。编程求解x,y,z所有可能解。输入: 测试数据有多组,输入n。输出: 对于每组输入,请输出x,y,z所有可行解,按照x,y,z依次增大的顺序输出。样例输入: 40样例输出: x=0,y=0,z=100x=0,y=1,z=99x=0,y=2,z=98x=1,y...原创 2018-03-04 15:05:21 · 246 阅读 · 0 评论