回 帖 发 新 帖 刷新版面

主题:高手们救救我


高手们救救我,帮我找找哪里错了




单元
unit music;
  interface
  uses crt;
    procedure play (octave,note,duration:integer);
    implementation
      procedure play;
        const base=32.625;
      var x:real; i:integer;
      begin
        if note = 0 then delay(duration)
              else
              begin
               x:=base;
               for i:= 1 to octave do
                x:=x* 2;
                for i:=1 to note-1 do
                x:=x *1.059463994;
                sound(round(x));
                delay(duration);
                nosound;
                end;
                end;
                end.
主程序:
program p11_7(songfile);
uses music;
var
songfile:text;
octave,note,duration:integer;
begin
assign(songfile,'song1.dat');
reset(songfile);
while not eof(songfile) do
  begin
  readln(songfile,octave,note,duration);
  play(songfile,octave,note,duration);
  end;
  close(songfile);
  end.

回复列表 (共2个回复)

沙发

......
有报错情况吗?用的什么软件编译?

板凳


没错

我来回复

您尚未登录,请登录后再回复。点此登录或注册