一个超简单的PASCAL程序,角度制转弧度制的……
pascal吧
全部回复
仅看楼主
level 9
本人高一,目前正在学习数学必修4的知识,正好里面有角度制转弧度制的,跟大家分享下……还有,本人是PASCAL的初学者,学艺不精,望大家多多指教
PROGRAM ZHUANHUANJIAO (input,output);
const pi=3.1415926;var
alfa,a,n:real; begin
writeln('please write the n'); readln(n); a:=pi/180; alfa:=n*a; writeln(alfa) end.
2013年03月13日 14点03分 1
level 9
而且,我还有个小问题……这程序在DOS运行时,只计算一次,计算完后就变成请按任意键退出了……怎样实现无数次计算呢?………………目前自学《PASCAL程序设计(第二版)郑启华编的》………………学PASCAL的目的是去考NOI……
2013年03月13日 14点03分 2
level 9
问下,如何使程序实现连续使用……意思是,我的程序,执行了n的运算后就退出了……有什么办法可以连续输入n的值进行运算吗?
2013年03月13日 14点03分 3
level 7
PROGRAM ZHUANHUANJIAO (input,output);
const a=3.1415926/180;
var n:real;
begin
repeat
writeln('please write the angel:'); readln(n);
if n < 0 then break;
writeln('alfa=', n*a);
until false;
end.
2013年03月13日 22点03分 4
until false是配合REPRAT使用的?
2013年03月14日 13点03分
回复 M109战斗机 :嗯 死循环 使无限执行其中的的步骤
2013年08月31日 11点08分
或者写 while true do什么的我记得我以前写过while 1=1 do和while1+1=2 do
2015年03月07日 13点03分
level 7
program transform;
var in,i:integer, inp:string;
begin
i:=1;
while i=1 do begin
readln(inp);
if copy(inp,length(inp)-3,length(inp)) = 'rad' then begin
var(in,inp);
writeln(in*180/3.14
15926535897
9); end;
if copy(inp,length(inp)-3,length(inp)) = 'deg' then begin
var(in,inp);
writeln(in*3.14
15926535897
9/180); end; end; end.
2013年03月13日 23点03分 5
2013年3月14日21时49分53秒 编译…… 失败。第2行,字符5附近失败: 语法错误,找到 "in" ,但缺少 "identifier"
2013年03月14日 13点03分
将in改为其他的东西就可以了
2013年03月14日 14点03分
[汗]你这写的啥东西
2013年08月31日 11点08分
回复 tinlinzzs :自己看这坟是谁挖的 我从不挖坟
2013年08月31日 12点08分
level 12
Math库中RadToDeg就行了
2013年03月15日 13点03分 6
level 7
可以试试begin后加while not eof do begin 然后再在最后加个end;
2015年03月07日 14点03分 7
警告[WARNING SIGN]勿挖坟
2015年03月08日 02点03分
回复 Goals20 :。。。这坟不是我挖的
2015年03月08日 02点03分
回复坟贴[WARNING SIGN]
2015年03月08日 05点03分
1