我想在 控制台的一个固定位置显示我变化的序号.
比如:
----------------------
aaaaaaaaaa
在这个位置显示我1-100之间变化的序号.怎么做?
|
|
|
|
|
|
88 谢谢大虾!

解决方案 »

  1.   

    ===========================感觉回到了DOS时代=========================program Project1;uses
      Windows, SysUtils;{$APPTYPE CONSOLE}          //控制台程序这个是必须var
      c: char;
      i,j,m,n,k: integer;
    begin
      Write('请输入序列下限值:');
      Read(m);
      Write('请输入序列上限值:');
      Read(n);
      Write('请输入序列显示位置:');
      Read(k);
      WriteLn('----------------------');
      WriteLn('aaaaaaaaaa');
      for i:=m to n do
      begin
        for j:=1 to k do Write(' ');
        WriteLn(i);
      end;
      WriteLn('----------------------');
      Write('输入Q退出');
      while (c<>'q') and (c<>'Q') do Read(c);
    end.
      

  2.   

    运行结果是这样的..-----------------
    aaaaaaa
    1
    2
    3
    4
    5
    6
    -------------
    而我想的是 
    -----------------
    aaaaaaa
    1 //在1这个位置显示1-10
    -------------
      

  3.   

    WriteLn(i); -〉Write(Format('%d ',[i]));
      

  4.   

    lynmison :
    这个仍然不是我想要的东西
    运行结果
    --------------
    aaaaaaaaaa
    12345678 ---------
    这样了.
    我的目的是:
    ------------------
    aaaaaaaaa
    1 //在1的位置显示其他数字.2要把1的位置占据,这样1就不在了,成2了,依此类推。
      

  5.   

    program Project1;uses
      Windows, ShellApi, SysUtils;{$APPTYPE CONSOLE}{  移动输入光标焦点到指定的坐标范围}
    procedure GotoXY(X, Y: Word);
    var
      Coord: _COORD;
    begin
      Coord.X := X;
      Coord.Y := Y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), Coord);
    end;var
      c: char;
      i,j,m,n,k: integer;
    begin
      Write('请输入序列下限值:');
      Read(m);
      Write('请输入序列上限值:');
      Read(n);
      Write('请输入序列显示位置:');
      Read(k);
      WriteLn('----------------------');
      WriteLn('aaaaaaaaaa');
      for i:=m to n do
      begin
        for j:=1 to k do Write(' ');
        GotoXY(k,6);
        Write(Format('%d ',[i]));
        Sleep(100);
      end;
      GoToXY(0,7);
      WriteLn('');
      WriteLn('----------------------');
      Write('输入Q退出');
      while (c<>'q') and (c<>'Q') do Read(c);
    end.