问答题

下面的程序是用do__while语句计算10的阶乘。请在程序的每条横线处填写一个语句,使程序的功能完整。 注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。 public class DoWhileLoop{ public static void main(_____________){ int n=10; long result=1; do { __________________ } __________________ System. out.println( "10的阶乘为: "+result); } }

【参考答案】

String args[] result*=n--; while(n>=1);[解析] 本题主要考查main()主方法的......

(↓↓↓ 点击下方‘点击查看答案’看完整答案 ↓↓↓)
热门 试题