先生に下記を改変するとやりやすいといわれました。repeatとwhileとforまでしか習っていません。 Score :array[0..1000] of integer; begin writeln('入力得点の平均と偏差値を計算します'); writeln('入力後、負の数を入力すると…終了します。'); kazu :=0; repeat write('点数は?'); readln(data); if data >= 0 then begin kazu := kazu + 1; score[kazu] := data end until data < 0; goukei := 0; for i := 1 to kazu do goukei := goukei + score[i]; heikin :=goukei / kazu; goukei :=0; for i := 1 to kazu do goukei := goukei + Sqr(score[i]); hensa := sqrt(goukei /kazu - sqr(heikin)); writeln('点数 偏差値'); for i := 1 to kazu do writeln(score[i]:4, 50 +10 * (score[i]-heikin)/ hensa:10:1); writeln(' 平 均 =',heikin:5:1); writeln('標準偏差=',hensa:5:1); readln; end.
RS := TResourceStream.Create(hInstance,'HOGE','MP3'); try if FileExists(ExtractFilePath(Application.ExeName)+'HOGEHOGE.mp3') = False then begin RS.SaveToFile(ExtractFilePath(Application.ExeName)+'HOGEHOGE.mp3'); end; finally RS.Free; end; if FileExists(ExtractFilePath(Application.ExeName)+'HOGEHOGE.mp3') then with MediaPlayer1 do begin Filename := ExtractFilePath(Application.ExeName)+HOGEHOGE.mp3'; end;