Pep9课下作业
Pep9课下作业
编写一个伪代码算法,读入三个值,输出它们的和。
点击查看代码
Set sum to 0
Read num 1
set sum to sum+num1
read num2
set sum to sum+num2
read num3
set sum to sum+num3
if(sum<0)
write "error"
else
write sum
Set sum to 0
Read num 1
set sum to sum+num1
read num2
set sum to sum+num2
read num3
set sum to sum+num3
if(sum<0)
write "error"
else
write sum