关于算法的问题???谢谢帮助!!UP也可以来!!!!例如:现在有一个数据库,里面有N行数据,都是7位数的,
1234567
7654123
4456123
。
。
1452354 计算后我想得到结果是: 第一位里0出现了几次,1出现了几次,9出现了几次?
第二位里。
。
第七位。。 可我刚学编程,作不出来,谁有代码给我看看或给些思路???????????
1234567
7654123
4456123
。
。
1452354 计算后我想得到结果是: 第一位里0出现了几次,1出现了几次,9出现了几次?
第二位里。
。
第七位。。 可我刚学编程,作不出来,谁有代码给我看看或给些思路???????????
Count : array[0..9] of integer;Table.First
While not Table.Eof do
begin
Str := fieldbyname('fieldname').asstring;
for j := 1 to 7 do
begin
if str[i] :=0 then Inc(Count[0]);
if str[i] :=1 then Inc(Count[1]);
if str[i] :=2 then Inc(Count[2]);
if str[i] :=3 then Inc(Count[3]);
if str[i] :=4 then Inc(Count[4]);
if str[i] :=5 then Inc(Count[5]);
if str[i] :=6 then Inc(Count[6]);
if str[i] :=7 then Inc(Count[7]);
if str[i] :=8 then Inc(Count[8]);
if str[i] :=9 then Inc(Count[9]);
end;
Table.next;
end;
那显示部分呢???如何显示?????