F
fisheryj
Unregistered / Unconfirmed
GUEST, unregistred user!
对SIN函数进行抽样 一个周期(2*pi)内取64个点把这些点的值,一十六进制的格式保存在<br>yujian.txt文件里<br>100分<br>program Projt2;<br><br><br><br>uses<br> Windows, Messages, SysUtils,math,Variants, Classes, Graphics, Controls, Forms,<br> Dialogs;<br><br><br><br>const<br>pi =3.1415927;<br>var<br><br> i:integer;<br> x:real;<br> y:real;<br> filename:TextFile;<br> Name:string;<br> j:integer;<br>begin<br> name:='d:/yujian.txt';<br> assignfile(FileName,name);<br> reset(FileName);<br> i:=0;<br>repeat<br><br> x:=i div 64*2*pi;<br> y:=sin(x);<br> writeln(filename,format('%x',[123])<br>);<br> write(filename,',');//用,来区分每个数<br> if i>64 then break;<br> i:=i+1;<br>until (false);<br><br> closefile(filename);<br><br><br>end.<br>