level 1
我试过e:= a ** b,可是出错了救命啊,比赛拉~~怕怕啊
2005年10月12日 13点10分
1
level 1
是用哪个compiler?** 这个operator要fp才支援
2005年10月12日 17点10分
3
level 1
噢! 对不起, 是我弄错了uses math;begin writeln(power(2, 3))end.
2005年10月12日 17点10分
4
level 1
我不知道什么是compiler,我用TP,能告诉我吗?
2005年10月13日 05点10分
5
level 0
如2的5次方y=2^5 {‘^’符号Pascal里没有}ln(y)=ln(2^5) {取e的对数}ln(y)=5*ln(2)e^ln(y)=y=e^(5*ln(2))=EXP(5*ln(2))所以2的5次就是EXP(5*ln(2)) {EXP和ln函数在Pascal里有}数学好的应该看的懂!
2005年10月13日 09点10分
7
level 1
好像有乘方的函数的吧 去找找看!!~~~~~~~~~~~~~~~~
2005年10月13日 10点10分
8
level 1
多谢各位的支持,你们说的方法,我都会去试,有更好的方法,就继续顶...
2005年10月13日 14点10分
12
level 6
经过尝试如果使用Variants单元那么可以使用**作为乘方运算样例:uses Variants;begin writeln(3**5); writeln(5**6); writeln(4**10);end.
2005年10月15日 03点10分
14
level 5
15楼说得没错需要注意:如果是整型/长整的话,需要用Trunc(Exp(y*Ln(x)))求x^y
2005年10月16日 10点10分
17
level 0
write(' Gender? (M/F) '); readln(t_chr); if (t_chr <> 'M') and (t_chr <> 'F') then writeln('Oops! Invalid gender. M or F only.'); until (t_chr = 'M') or (t_chr = 'F'); writeln(new_source, t_chr); repeat write(' Age? '); readln(t_str2); val(t_str2, t_int, t_int2); if (t_int2 <> 0) or (t_int < 10) or (t_int > 100) then writeln('Oops! Invalid age.'); until (t_int2 = 0) and (t_int >= 10) and (t_int < 100); writeln(new_source, t_int); repeat write(' Graduation year? '); readln(t_str2); val(t_str2, t_int, t_int2); if (t_int2 <> 0) or (t_int < 1950) or (t_int > 2010) then writeln('Oops! Invalid year.'); until (t_int2 = 0) and (t_int >= 1950) and (t_int <= 2010); writeln(new_source, t_int); repeat write(' How many family members is ', t_str, ' going to bring with? '); readln(t_str2);
2005年10月20日 02点10分
21
level 0
不是说竞赛语言改用FreePascal了吗?就用 ** 就可以表示乘方了
2005年10月20日 05点10分
22