JSP第一次作业

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>

<body>
    This is my JSP page.
    <br>
</body>
<%
    int i, j, sum = 0;
    for (i = 1; i < 100; i++) {
        for (j = 2; j < i; j++) {
            if (i % j == 0) {
                break;
            }
        }
        if (j == i) {
            sum += i;
        }
    }
%>
<%=sum%>
</html>

  

posted @ 2021-03-15 14:57  无法显示  阅读(24)  评论(0编辑  收藏  举报