<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> 你好,这是我的第一个jsp <br> <p>求1-100的偶数之和</p> <br> 值为: <% int s=0; for(int a = 1;a<101;a++){//循环数 if(a%2==0){ s+=a; } } out.print(s);//输出值 %> </body> </html>