POJ 1003(小数处理?)

内容目录

此题题目看了半天……才发现是水题

Program P1003;
var
   a:array[0..10000] of double;
   i,j:longint;
   n:double;
begin
   i:=1;
   a[0]:=0;
   while a[i-1]<5.2 do
   begin
      a[i]:=a[i-1]+1/(i+1);
      inc(i);
   end;
   read(n);
   while n<>0.00 do
   begin
      i:=0;
      while a[i]<n do inc(i);
      writeln(i,' card(s)');
      read(n);
   end;
   writeln;
end.