Home >php教程 >PHP开发 >Simple example of jsp output pyramid

Simple example of jsp output pyramid

高洛峰
高洛峰Original
2016-12-29 15:38:581277browse

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

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!


Statement:
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