<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>1-100素数之和</title> </head> <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; } } %> 1-100之间的素数之和为: <%=sum%> </body> </html>