当前位置:网站首页>C语言打印杨辉三角
C语言打印杨辉三角
2022-08-08 21:02:00 【Kichlvichn·хуту】
#include <stdio.h>
void main( )
{
int j;
int count;
printf("请输入要打印的行数:");
scanf("%d",&count);
for (int i = 1; i <= count; i++)
{
for(int k = 1; k <= count - i;k++)
{
printf(" ");
}
for(j = 1; j <= i; j++)
{
printf("%d",j);
}
for (int n = j - 2; n > 0; n--)
{
printf("%d", n);
}
printf("\n");
}
}
边栏推荐
猜你喜欢
随机推荐
【项目经验】--环保项目
GeoServer入门学习:07-发布多层级TIF地图大图数据
Under the Windows socket (TCP) console program
Flask 教程 第四章:数据库
单片机——DHT11 温湿度传感器
SQL-堆叠注入(含例题)
rancher坑记录
【Excel template download with information】
Gradle is as simple as using kotlin to write common commands
GeoServer入门学习:01-开篇
Kotlin笔记-ForEach与ForEachIndexed区别
[MEF] Chapter 04 MEF's Multi-Component Import (ImportMany) and Directory Services
澳洲ABM创新模式将销售代理权给到个体,让利消费者
phpmyadmin 4.8.1 远程文件包含漏洞(CVE-2018-12613)
Protobuf框架与WebAPI
2 Scrapy
二叉树前序遍历、中序遍历、后序遍历的迭代版
The new library online | CnOpenDataA shares of the listed company basic information data
Introduction to GeoServer: 01-Introduction
【读代码重构有感】







