请问For 循环如何嵌套if?
maple吧
全部回复
仅看楼主
level 1
Lighting1196 楼主
请问For 循环如何嵌套if?
2015年11月29日 17点11分 1
level 3
for(a=0;a<10;a++)

if(a=1)

b++;


2015年12月01日 13点12分 2
这是c++吧
2015年12月01日 14点12分
@Lighting1196 c++判断是否相等用两个=
2015年12月07日 00点12分
@beechcraft Maple还可以用这种格式?
2015年12月07日 08点12分
@Lighting1196 当然不行
2015年12月07日 08点12分
level 3
for中没每执行一次,就用if判断一次a。。。
后面可以加 if a=2,3,4之类的
2015年12月01日 13点12分 3
如何让if内部的值输出显示,例如if包含一个x,如何让这个x的值显示出来?
2015年12月01日 14点12分
level 2
local j, X, x;
X := [1,3,4,5,7];
for j from 1 to nops(X) do
x := op(j, X);
if type(x, prime) then
print(x);
fi;
od;
2015年12月07日 06点12分 4
多谢回复,另外,结尾那两句是什么意思啊?
2015年12月07日 08点12分
@Lighting1196 if语句结束使用fi,和if对应。for循环体结束用od,和do对应。
2015年12月07日 14点12分
@计算机241亦凡 好厉害!Maple帮助文档里面好像都没有介绍,只要end if和end do。你是从哪里知道这种用法的啊?
2015年12月07日 15点12分
对啦,For 有没有并行形式啊?类似matlab的parfor。
2015年12月07日 15点12分
level 7
还以为进了c语言吧。。。
2015年12月08日 07点12分 5
如果不是专业程序员,感觉没必要用C语言啊
2015年12月08日 08点12分
1