您的位置:首页 > 其它

[SGU]107. 987654321 problem

2012-10-01 18:09 253 查看
Analysis

第一个想法是枚举,然后发现1到9位数中满足这样条件的只有8个……然后就很easy了

Accepted Code

var
n:longint;
begin
readln(n);
if n<=8 then
writeln(0)
else
if n=9 then
writeln(8)
else
begin
write(72);
dec(n,10);
while n>0 do
begin
dec(n);
write(0);
end;
writeln;
end;
end.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: