精华帖 (3) :: 良好帖 (10) :: 隐藏帖 (1)
|
|
---|---|
作者 | 正文 |
发表时间:2009-07-14
真的 人家出题 为什么没个条件呢 大家想过吗 要是 abc 不是0到9 那不无限解了吗
|
|
返回顶楼 | |
发表时间:2009-07-15
laogao3232 写道 都是马后炮,还是最早那位用sql解出来的大哥猛!
正解 |
|
返回顶楼 | |
发表时间:2009-07-15
icefishc 写道 create table n_table (n int) -- n 为 0..9 select a.n, b.n, c.n from n_table a, n_table b, n_table c where 11 * (a.n + b.n + c.n) = a.n * 100 + b.n * 10 + c.n 太强了,佩服! |
|
返回顶楼 | |
发表时间:2009-07-15
rickwang 写道 laogao3232 写道 都是马后炮,还是最早那位用sql解出来的大哥猛!
让我想起一句经典批评用语:事后诸葛亮,事前猪一样~ 我喜欢这句话 |
|
返回顶楼 | |
发表时间:2009-07-15
rickwang 写道 例子:11+99+88=198,求满足这样要求的数,1,9,8等等~
niubinity啊 |
|
返回顶楼 | |
发表时间:2009-07-16
TX也出这样的NC题
|
|
返回顶楼 | |
发表时间:2009-07-23
fonix 写道 select t1.x, t2.x, t3.x from
(select 0 x from dual union select 1 x from dual union select 2 x from dual union select 3 x from dual union select 4 x from dual union select 5 x from dual union select 6 x from dual union select 7 x from dual union select 8 x from dual union select 9 x from dual) t1, (select 0 x from dual union select 1 x from dual union select 2 x from dual union select 3 x from dual union select 4 x from dual union select 5 x from dual union select 6 x from dual union select 7 x from dual union select 8 x from dual union select 9 x from dual) t2, (select 0 x from dual union select 1 x from dual union select 2 x from dual union select 3 x from dual union select 4 x from dual union select 5 x from dual union select 6 x from dual union select 7 x from dual union select 8 x from dual union select 9 x from dual) t3 where t1.x*10+t1.x+t2.x*10+t2.x+t3.x*10+t3.x=t1.x*100+t2.x*10+t3.x 语法也许有错误,逻辑上是这个意思,用穷举法解决问题 三个表,都各有0到9共计10个数字,10条记录 关联查询三个表,尝试1000种组合,where条件就是题目中要求的条件。符合条件的所有3个数字的组合会被select语句查询出来 |
|
返回顶楼 | |
发表时间:2009-07-27
icefishc 写道 create table n_table (n int) -- n 为 0..9 select a.n, b.n, c.n from n_table a, n_table b, n_table c where 11 * (a.n + b.n + c.n) = a.n * 100 + b.n * 10 + c.n 佩服!! |
|
返回顶楼 | |
发表时间:2009-07-30
icefishc 写道 create table n_table (n int) -- n 为 0..9 select a.n, b.n, c.n from n_table a, n_table b, n_table c where 11 * (a.n + b.n + c.n) = a.n * 100 + b.n * 10 + c.n 啧 |
|
返回顶楼 | |
发表时间:2009-08-05
icefishc 写道 create table n_table (n int) -- n 为 0..9 select a.n, b.n, c.n from n_table a, n_table b, n_table c where 11 * (a.n + b.n + c.n) = a.n * 100 + b.n * 10 + c.n 受益了 |
|
返回顶楼 | |