public class Solution
 {
     public static void main(String[] args)
     {
         int count = 0;

         for(int i = 1; i <= 100; i++)
         {
             System.out.print(getPentagonalNumber(i) + " ");
             count++;

             if(count == 10)
             {
                 System.out.println();
                 count = 0;
             }
         }
     }

     public static int getPentagonalNumber(int n)
     { return n * (3 * n - 2) / 2; }
 }

HW5.1的更多相关文章

  1. HW5.36

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  2. HW5.35

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  3. HW5.34

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  4. HW5.33

    import java.util.Calendar; public class Solution { public static void main(String[] args) { long tot ...

  5. HW5.32

    public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...

  6. HW5.31

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  7. HW5.30

    public class Solution { public static void main(String[] args) { for(int i = 3; i <= 1000; i++) i ...

  8. HW5.29

    public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...

  9. HW5.28

    public class Solution { public static void main(String[] args) { System.out.printf("%s\t%s\n&qu ...

  10. HW5.27

    public class Solution { public static void main(String[] args) { int totalCount = 0; int lineCount = ...

随机推荐

  1. NodeJS+ExpressJS+SocketIO+MongoDB应用模板

    OS:Win8.1 with update 关键字:NodeJS,ExpressJS,SocketIO,MongoDB. 1.源代码下载:https://github.com/ldlchina/ESM ...

  2. 关于oi

    2015-12-26 今天在机房,楼上的孩子发下来一个exe,善良无知的我打开了那个exe,然后电脑就关机了.萌萌的辅导老师看到之后就不再萌萌哒,他跑到五楼训斥了那群孩子们一顿(自行脑补).出于报复, ...

  3. SWFUpload 按钮显示问题

    问题: 今天遇到一个这样的问题,我用Vs2010打开用SWFUpload上传文件的网页时,按钮显示不出来,试了好多方法,终于被我找到了! 解决方法: 原来是vs2010自带的Asp.net Devel ...

  4. iOS 设置代理过程

    iOS设置代理的过程 (以模拟 button 作用为例) 1.写协议 新建一个名为 MyButton 的文件,继承于 UIView,在该文件里 声明协议 myDelegate 2.写协议方法 为声明的 ...

  5. CSS3实战:让我们尽情的圆角吧

    如果说,WAP2.0网页的机型.浏览器适配给我们无线制作经理造成了巨大的心理 阴影,那么从iPhone.Android这些高端手机应用 起,我们终于可以庆幸比其他同行提 前迎来了一个新时代,这两种高端 ...

  6. CSS跨浏览器(转)

    本文将介绍兼容IE+.FF.Chrome.Safari.Opera的技巧 一.CSS HACK 专门为某版本的浏览器设置样式,从而解决浏览器显示的差异 selector { +property:val ...

  7. MySQL JDBC的setFetchSize

    MySQL JDBC的setFetchSize http://uuhorse.iteye.com/blog/2163582 http://blog.sina.com.cn/s/blog_6706203 ...

  8. 插入排序InsertionSort

    /** * * @author Administrator * 功能:插入排序法 */ package com.test1; import java.util.Calendar; public cla ...

  9. Excel Cannot Connect to SharePoint List

    As I am working in SharePoint support, I come across so many issues on day 2 day basis and always tr ...

  10. MPlayer

    名称   mplayer − 电影播放器 mencoder − 电影编解码器 概要   mplayer [选项] [文件|URL|播放列表|−] mplayer [选项] 文件1 [指定选项] [文件 ...