zoukankan      html  css  js  c++  java
  • 计算1-100中的素数之和

    代码:

    <%@ 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>

  • 相关阅读:
    2018CodeM复赛
    poj3683
    bzoj3991
    bzoj2809
    bzoj1001
    bzoj1412
    计蒜之道2018复赛
    HDU2255
    bzoj1010
    bzoj2006
  • 原文地址:https://www.cnblogs.com/3469656421aixz/p/14481579.html
Copyright © 2011-2022 走看看