Home > php教程 > PHP开发 > body text

Simple example of jsp output pyramid

高洛峰
Release: 2016-12-29 15:38:58
Original
1257 people have browsed it

JSP Output Pyramid Simple Example

<% 
  String str = "";
  for(int i = 1; i <= 5; i++){
    for(int j = 1; j <= 5-i; j++){
      str +="    ";
    }
    for(int k = 1; k <= 2*i-1; k++){
      str +="☆";
    }
    str +="<br>";
}
%>
<%= str %>
Copy after login

Simple example of jsp output pyramid

The above is the simple example of JSP Output Pyramid brought to you by the editor. I hope everyone will support PHP Chinese. Net~

For more simple examples of jsp output pyramid related articles, please pay attention to the PHP Chinese website!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template