例如这个简单的程序,用于测试3个数字是否按升序排列
if a1<a2 then
if a2<a3 then
write "the numbers are in ascending order";
else
write "the numbers are not in ascending order";
endif
else
write "the numbers are not in ascending order;
endif
我可以用伪代码这样写吗?
if (a1<a2 and a2<a3)
write "the numbers are in ascending order";
else
write "the numbers are not in ascending order";
答案 0 :(得分:0)
是的。只要可以理解并且可以轻松地将其转换为真实的源代码,就可以使用伪代码。