讨论 / 绝对的水题---一次AC
zengyanjie1999 2011-08-30 22:03:00
点我顶贴 收藏 删除
有效耗时: 3109毫秒

测试结果1: 通过本测试点|有效耗时156ms

测试结果2: 通过本测试点|有效耗时47ms

测试结果3: 通过本测试点|有效耗时47ms

测试结果4: 通过本测试点|有效耗时47ms

测试结果5: 通过本测试点|有效耗时47ms

测试结果6: 通过本测试点|有效耗时62ms

测试结果7: 通过本测试点|有效耗时375ms

测试结果8: 通过本测试点|有效耗时969ms

测试结果9: 通过本测试点|有效耗时969ms

测试结果10: 通过本测试点|有效耗时390ms

提交代码:

view sourceprint?

01.

program number;

02.

var a:array[1..500000]of int64;

03.

s:array[1..500000]of string;

04.

num:array[0..9]of int64;

05.

i,j,m,n,k:longint;

06.

begin

07.

read(m,n);

08.

k:=n-m+1;

09.

a[1]:=m;

10.

for i:=0 to 9 do

11.

num[i]:=0;

12.

for i:=2 to k do

13.

a[i]:=a[i-1]+1;

14.

for i:=1 to k do

15.

str(a[i],s[i]);

16.

for i:=1 to k do

17.

for j:=1 to length(s[i]) do

18.

begin

19.

if s[i][j]='0' then num[0]:=num[0]+1;

20.

if s[i][j]='1' then num[1]:=num[1]+1;

21.

if s[i][j]='2' then num[2]:=num[2]+1;

22.

if s[i][j]='3' then num[3]:=num[3]+1;

23.

if s[i][j]='4' then num[4]:=num[4]+1;

24.

if s[i][j]='5' then num[5]:=num[5]+1;

25.

if s[i][j]='6' then num[6]:=num[6]+1;

26.

if s[i][j]='7' then num[7]:=num[7]+1;

27.

if s[i][j]='8' then num[8]:=num[8]+1;

28.

if s[i][j]='9' then num[9]:=num[9]+1;

29.

end;

30.

for i:=0 to 9 do

31.

write(num[i],' ');

32.

end.

查看更多回复
提交回复