有1至9,9个不同的数字,组成三个三位数,要求第二个三位数是第一个三位数的两倍,第三个三位数是第一个三位数的三倍,请列出三个三位数是多少?
怎么样算啊?
怎么样算啊?
解决方案 »
- 收集常用的js兼容性问题
- 一个随机生成的问题!很急!一天16小时在线等!
- 高手请答,分不够再加
- 急!js 被缓存了,为什么还要白屏等待?
- 看看这样的状态码是不是正确的301,急呀
- 分组显示,用户自定义如何实现?急
- 各位对女人了解的大哥,帮帮忙,关于小弟的一生幸福!
- RequiredFieldValidator控件运行时报错:无法找到脚本库"/aspnet_client/system_web/1_1_4322/WebUIValidation.js".请尝试手动放置此文件,
- 急急!!!DataList的DataKeyField能不能设置多列,因为我的主键有多个属性,谢谢
- ASP.NET开发中的一个简单问题
- 如何控制内嵌框架中滚动条的位置??
- GridView控件“编辑”但不能“更新”,报错如下:
declare @i int
set @i =111
while @i<=999
begin
insert into #t values(Convert(varchar(3),@i))
set @i=@i+1
end
--删除有重复的数
delete from #t where(substring(name,1,1) = substring(name,2,1) or substring(name,1,1) =substring(name,3,1))
delete from #T where name like '%0%' --删除带0的数select convert(int ,name),convert(int ,name) *2,convert(int ,name) *3 from #t
where convert(int ,name) *2 in (select * from #t)
and
convert(int ,name) *3 in (select * from #t)
order by name or (substring(name,2,1) = substring(name,3,1))
create table #t( name varchar(3))
declare @i int
set @i =111
while @i<=999
begin
insert into #t values(Convert(varchar(3),@i))
set @i=@i+1
end
--删除有重复的数
delete from #t where(substring(name,1,1) = substring(name,2,1) or substring(name,1,1) =substring(name,3,1)) or (substring(name,2,1) = substring(name,3,1))delete from #T where name like '%0%' --删除带0的数select convert(int ,name),convert(int ,name) *2,convert(int ,name) *3 from #t
where convert(int ,name) *2 in (select * from #t)
and
convert(int ,name) *3 in (select * from #t)
order by name
for(int i=1098;i>=600;i-=6)
{
num[0] = i/6;
num[1] = num[0] * 2;
num[2] = num[0] * 3;
//判断,这样应该可以吧
}
219 438 657
273 546 819
327 654 981
for (int i = 1; i <= 3; ++i)
{
for (int j = 1; j <= 9; ++j)
{
if (j == i) continue;
for (int k = 1; k <= 9; ++k)
{
if (k == i || k == j) continue;
int n1 = i*100 + j*10 + k;
int n2 = 2 * n1;
int n3 = 3 * n1;
int a = n2 % 10;
if (a == i || a == j || a == k || a == 0) continue;
int b = n2 % 100 / 10;
if (b == i || b == j || b == k || b == a || b == 0) continue;
int c = n2 / 100;
if (c == i || c == j || c == k || c == a || c == b || c == 0) continue;if (n3 > 999) continue;
int d = n3 % 10;
if (d == i || d == j || d == k || d == a || d == b || d == c || d == 0) continue;
int e = n3 % 100 / 10;
if (e == i || e == j || e == k || e == a || e == b || e == c || e == d || e == 0) continue;
int f = n3 / 100;
if (f == i || f == j || f == k || f == a || f == b || f == c || f == d || f == e || f == 0) continue;
Console.WriteLine("{0} {1} {2}", n1, n2, n3);
}
}
}
做出来了,谢谢各位!