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://codercto.com/courses/l/17.html

查看所有标签

Learning PHP 5

Learning PHP 5

David Sklar / O'Reilly / July, 2004 / $29.95

Learning PHP 5 is the ideal tutorial for graphic designers, bloggers, and other web crafters who want a thorough but non-intimidating way to understand the code that makes web sites dynamic. The book ......一起来看看 《Learning PHP 5》 这本书的介绍吧!

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具