C 练习实例10

C 语言教程 · 2019-02-21 14:27:45

题目:打印楼梯,同时在楼梯上方打印两个笑脸。

程序分析:用 ASCII 1 来输出笑脸;用i控制行,j来控制列,j根据i的变化来控制输出黑方格的个数。

如果出现乱码情况请参考【C 练习实例7】的解决方法。

实例

// Created by www.codercto.com on 15/11/9. // Copyright © 2015年 码农教程. All rights reserved. // #include<stdio.h> int main() { int i,j; printf("\1\1\n"); /*输出两个笑脸*/ for(i=1;i<11;i++) { for(j=1;j<=i;j++) printf("%c%c",219,219); printf("\n"); } return 0; }

以上实例输出结果为:

点击查看所有 C 语言教程 文章: https://www.codercto.com/courses/l/17.html

查看所有标签

Introduction to Computation and Programming Using Python

Introduction to Computation and Programming Using Python

John V. Guttag / The MIT Press / 2013-7 / USD 25.00

This book introduces students with little or no prior programming experience to the art of computational problem solving using Python and various Python libraries, including PyLab. It provides student......一起来看看 《Introduction to Computation and Programming Using Python》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

在线进制转换器
在线进制转换器

各进制数互转换器

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具