英语翻译Use Psendocodeto write an algorithm:Read a number N,then

英语翻译
Use Psendocodeto write an algorithm:Read a number N,then multiply all the numbers from 1 toN (for example :if N is 5 then add 1*2*3*4*5),Print out the final product.
yang1984mm 1年前 已收到3个回答 举报

ftcr997 花朵

共回答了28个问题采纳率:85.7% 举报

用psendocode(伪码)写一个算法:
读一个数N
然后把从1到N的数全部乘起来(比如:N=5,那么结果就是1*2*3*4*5)
打出最终的结果.
这个题目的答案是:
Read a N;
int n=N;
int result=1;
while(n>=1)
{
result=n*result;
n=n-1;
}
print out result;

1年前

2

CLeon 幼苗

共回答了20个问题 举报

使用psendocodeto写一个算法:读一个数,然后把所有的数字从1吨(例如:如果n是5,然后添加1×2×3×4×5),打印出最终的产品。

1年前

1

摇曳的草 幼苗

共回答了1个问题 举报

使用Psendocodeto写一个算法:
读了一个数N,然后将所有这些数字从1到N相乘
(例如:如果N是5然后加1 * 2 * 3 * 4 * 5),
打印出最后乘积。

1年前

1
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 18 q. 0.034 s. - webmaster@yulucn.com