爱吃火腿肠 https://www.cnblogs.com/ichihtc/

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
public class Main {
    public static void main(String[] args) {
        fun();
    }
    public static void fun(){
        int n,j;
        //float s=0.0,t=1.0;//此行语句有错误,改正后填到下侧空格内
        float s=0.0f,t=1.0f;
        for(n=1;n<=5;n++){
            //s=1;//此行语句有错误,改正后填到下侧空格内
            t=1;
            for(j=1;j<=n;j++){
                //t=t*n;//此行语句有错误,改正后填到下侧空格内
                t=t*j;
            }
            //s+t=s;//此行语句有错误,改正后填到下侧空格内
            s=s+t;
        }
        System.out.printf("jiecheng=%.0f\n",s);
    }
}
posted on 2022-03-13 17:30  爱吃火腿肠  阅读(1235)  评论(0)    收藏  举报