本文介绍了帮我翻译成do的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
很抱歉不遵守此处的条款。现在我得逆转但我的问题我必须转换为什么同时你可以帮助我..这是代码
Sorry for not following the terms here. Now I got to reverse but my problem I have to convert the while into do while can you help me.. Here's the code
<html>
<head></head>
<script type ="text/javascript">
<html>
<head></head>
<script type ="text/javascript">
var reverse = 0;
var n = prompt("Enter reverse numbers: ");
while (n != 0) {
reverse = reverse * 10;
reverse = reverse + parseInt(n%10);
n = parseInt(n/10); }
document.write(" The reverse of the number: "+reverse);
</script>
<body>
</body>
</html>
and here's what I've done so far
var reverse = 0;
var n = prompt("Enter reverse numbers: ");
do {
reverse = reverse * 10;
reverse = reverse + parseInt(n%10);
n = parseInt(n/10); }
document.write(" The reverse of the number: "+reverse);
}while(n != 0);}
When I run this it output a blank. Don't know where I got mistake.
Thanks to your help God bless
推荐答案
这篇关于帮我翻译成do的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!