Lesson11 PoEdu培训第二课 C语言篇(3) 字符类型 随堂作业
文章类别: 培训作业 0 评论

Lesson11 PoEdu培训第二课 C语言篇(3) 字符类型 随堂作业

文章类别: 培训作业 0 评论

老师未批改

作业

使用printf输出如下格式(每个字符一个printf):
    /???
    /////a
需要注意换行和tab制表.

解答

程序源代码如下:

/*************************************************************************
    > 文件名: lesson11.hw01.c
    > 作者: 花心胡萝卜
    > 邮箱: hxhlb@hxcarrot.com
    > 创建时间: 2016-09-21 08:20:24
 ************************************************************************/

#include <stdio.h>

int main() {
    printf("%c", '\t');
    printf("%c", '\\');
    printf("%c", '\?');
    printf("%c", '\?');
    printf("%c", '?');
    printf("%c", '\n');
    printf("%c", '\t');
    printf("%c", '\\');
    printf("%c", '\\');
    printf("%c", '\\');
    printf("%c", '\\');
    printf("%c", '\\');
    printf("%c", 'a');

    return 0;
}

程序运行截图如下:
Alt 运行结果1

如有错误,请提出指正!谢谢.

回复