C#控制台打印简单【倒三角形】的图形
2024-10-20 07:45:47
今天想练习一下简单的打印图形,小弟没有学过什么算法,嘿嘿,以后有更好的想法继续修改...
static void InvertedTrainangle()
{
Console.WriteLine("请输入倒三角形的行数:");
int rows = int.Parse(Console.ReadLine());
//循环行数
for (int i = rows; i > ; i--)
{
//这个循环式控制对空格的输出 原理:空格数等于 从 0,1,2,...,rows-1 个
for (int z = ; z < rows - i; z++)
{
Console.Write(" ");
}
//这个循环控制 "*" 的输出,原理:个数=2*行-1
for (int j = ; j < * i - ; j++)
{
Console.Write("*");
}
Console.Write("\r\n");//换行
}
}
最新文章
- [原创]Matlab2016b打包为C++的lib文件
- MSDB数据库置疑的解决方法
- Linux之一条命令解决常见问题(持续更新)
- spark streaming kafka1.4.1中的低阶api createDirectStream使用总结
- Android进程守护
- 解决MySQL连接超时Communications link failure due to underlying exception
- odoo8 email
- Java同步工具类总结
- Do not wait until the conditions are perfect to begin. Beginning makes the conditions perfect(转)
- lxd-启动篇分析
- bash脚本基础
- 【Teradata】使用arcmain进行不落地数据迁移(管道)
- 解惑 [";1";, ";2";, ";3";].map(parseInt) 为何返回[1,NaN,NaN]
- Django----ModelFrom
- bs-loading
- scala 稀疏向量
- tomcat在conf/Catalina/localhost目录下配置项目路径
- mac activemq
- 三年半Java后端面试经历
- 扩展中国剩余定理 exCRT 学习笔记
热门文章
- web_custom_request应用示例
- .NET运用AJAX 总结及其实例
- Minitab中相关系数R-Sq和修正R-Sq(adj)的意思,计算公式和区别[转载]
- 关于最近Google无法正常访问的变通之法(已经被墙)
- git 学习笔记4--.gitignore
- discuz安装步骤
- c# 修饰词public, protected, private,internal,protected的区别
- uva-465(overflow)
- CF# Educational Codeforces Round 3 B. The Best Gift
- 使用递推解题:EOJ2999