打印杨辉三角
来源:互联网 发布:单片机串口通讯详解 编辑:程序博客网 时间:2024/06/05 03:20
杨辉三角
#include <stdio.h>int main(void){ int high, row, col; int a[10][10]; scanf("%d", &high); //存放数值 for(row = 0; row < high; row++) { a[row][0] = 1; a[row][row] = 1; } for(row = 2; row < high; row++) { for(col = 1; col < row; col++) { a[row][col] = a[row-1][col] + a[row-1][col-1]; } } //输出 for(row = 0; row < high; row++) { for(col = 0; col <= row; col++) printf("%-3d", a[row][col]); putchar('\n'); } return 0;}
0 0
- 打印杨辉三角
- 打印杨辉三角
- 打印杨辉三角
- 打印杨辉三角
- 打印杨辉三角
- 打印杨辉三角
- 打印杨辉三角
- 打印杨辉三角
- 打印-杨辉三角
- 打印杨辉三角
- 打印杨辉三角
- 打印杨辉三角
- 打印杨辉三角
- 杨辉三角打印
- 打印杨辉三角
- 杨辉三角打印
- 打印杨辉三角
- 打印杨辉三角
- Android 后台记录GPS轨迹并转为80参数service
- String解析->java
- struts2 s2-45漏洞利用
- 蓝桥杯 ADV-176 算法提高 陶陶摘苹果
- XMD
- 打印杨辉三角
- iOS开发技巧之:UIImage的剪切,尺寸缩小、压缩、添加水印
- org.springframework.transaction.CannotCreateTransactionException:
- 蓝桥杯 ADV-178 算法提高 简单加法
- 打印斐波那契(Fibonacci)数列
- java基础_day0008_循环_for_无限循环
- 打印升序降序字母金字塔
- 162. Find Peak Element
- 概率无向图模型