Output the Yanghui triangel
 
 
总提交数量: 225 通过数量: 59
 
     
     
 
时间限制:1秒    内存限制:256兆
题目描写叙述

Write program to output the Yanghui triangel of n*n, where n is an input. The Yanghui triangel is defined as

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

..........................

输入格式

Each  lines  of the input is an integer that denotes the dimension of the Yanghui triangel that will be outputted to the screen.

An input 0 denotes the end of the input.

输出格式

Each value of the output is followed by a TAB, include the last value of a line.

例子输入
将例子输入拷贝到剪贴板
5
6
7
0

例子输出
1
1   1
1   2   1
1   3   3   1
1   4   6   4   1
1
1   1
1   2   1
1   3   3   1
1   4   6   4   1
1   5   10  10  5   1
1
1   1
1   2   1
1   3   3   1
1   4   6   4   1
1   5   10  10  5   1
1   6   15  20  15  6   1

题目中的TAB表示制表符\t。一開始没注意看两位数输出和一位数输出也被坑慘了

转载于:https://www.cnblogs.com/liguangsunls/p/7224192.html

SOJ.Output the Yanghui triangel相关推荐

  1. Ubuntu 16.04 安装后修改屏幕分辨率(xrandr: Failed to get size of gamma for output default)

    ubuntu 16.04 安装后分辨率只有一个选项 1024x768,使用 xrandr 命令出现错误: xrandr: Failed to get size of gamma for output ...

  2. Angular No name was provided for external module 'XXX' in output.globals 错误

    Angular 7 开发自定义库时,引用ngZorroAntd,build过程中出现 No name was provided for external module 'ng-zorro-antd' ...

  3. Angular使用@Input和@Output实现父子组件互相传参(类似Vue的props和this.emit)

    app.component.html <app-in-out [in]='"传输进入"' (out)="out($event)" ></app ...

  4. 关于OSD::mkfs: ObjectStore::mkfs failed with error (5) Input/output error问题的解决

    环境: ceph L版本12.2.1升级到12.2.12 这个问题是由于升级后进行12.2.12环境中的使用ceph-disk 进行osd部署时出现如下问题,执行命令 ceph-disk -v pre ...

  5. Java孩子父母类,@Output孩子和父母之间的沟通 . 角2(5)

    我正在尝试学习角度2,并且我正在尝试使用来自我的子组件的数据在父组件中设置变量 . 基本上我在父视图中有一个子 Headers ,我希望 Headers 和一些HTML根据加载的子项进行更改 . 父组 ...

  6. This is probably not a problem with npm. There is likely additional logging output above

    微信小程序开发交流qq群   173683895    承接微信小程序开发.扫码加微信. E:\weii_objct\invoice-manage-web-view>npm start > ...

  7. SQL Server 储存过程的output 参数

    要做的参数的回传一方面要做到有储存过程的配合,再一方面也要有调用方法的配合,也就是说错误的调用方法是没有办法把值回传的. 下面是例子 --1.储存过程方面的配合 create procedure db ...

  8. ACMNO.10打印出所有水仙花数,所谓水仙花数是指一个三位数,其各位数字立方和等于该本身。 例如:153是一个水仙花数,因为153=1^3+5^3+3^3。 Output: 153 ???

    题目描述 打印出所有"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该本身. 例如:153是一个水仙花数,因为153=1^3+5^3+3^3. ...

  9. Loadrunner连接负载机失败,提示Failed to connect to the load generator.Check the output window for more detail

    在测试连接负载机时,为何连接不上呢,提示"Failed to connect to the load generator.Check the output window for more d ...

最新文章

  1. LeetCode简单题之1比特与2比特字符
  2. 模拟滤波器和数字滤波器
  3. 给运维工程师的Cheatsheets! 《Shell脚本速查手册》免费下!
  4. 把一个字符串里符合表情文字标签的地方全部替换为相应的图片的方法
  5. iPhone屏幕尺寸/launch尺寸/icon尺寸
  6. 神奇的python(二)之python打包成应用程序
  7. Python元组,列表,解构和循环
  8. 在Scala IDEA for Eclipse或IDEA里程序编译实现与在Spark Shell下的对比(其实就是那么一回事)...
  9. VC6.0工程设置说明
  10. iphone计算机照片大小,如何把iphone照片导入电脑 四种方法分享【图文】
  11. 焦点较中的网络视频相关
  12. 【尚硅谷 Java Web 笔记】表格的跨行跨列
  13. 【leetcode.179】最大数
  14. html怎么随机设置颜色,设置随机颜色值
  15. Word 2016 如何设置黑底白字
  16. Merlin部署KMS
  17. AD10 如何将焊盘的实心改为十字型覆铜
  18. 如何学c语言程序设计,如何学好C语言 | 新思维:C语言程序设计
  19. 硬件设计从0到1之基本工具
  20. !!! LVS项目----官方网址 !!!

热门文章

  1. P1506 拯救oibh总部(dfs,洛谷,java)
  2. 智能锁技术有哪些呢?
  3. Linux开胃菜,静态网络设置
  4. Dynamics CRM Report 报表开发
  5. updates/7/x86_64/primary_db FAILED
  6. android设备静默升级
  7. 斩获殊荣!香港中雲科技有限公司荣获“分布式文件系统创新奖”
  8. 如何在Xshell5中访问jupyter notebook(妈妈再也不用担心我在家还不学习了系列二)
  9. 【C++11智能指针】shared_ptr的初始化、拷贝构造和拷贝赋值、移动构造和移动赋值
  10. 一文详解ODBC、OLEDB、ADO、ADO.NET之间的关系