【C程序设计】习题3.6

avatar

azurekiln

#include <stdio.h>

int main() {
    char c1 = 'C', c2 = 'h', c3 = 'i', c4 = 'n', c5 = 'a';
    c1 += 4, c2 += 4, c3 += 4, c4 += 4, c5 += 4;

    //使用putchar输出 
    printf("使用putchar输出:\n"); 
    putchar(c1),putchar(c2),putchar(c3),putchar(c4),putchar(c5);

    //换行
    printf("\n\n"); 

    //使用printf输出
    printf("使用printf输出:\n"); 
    printf("%c%c%c%c%c",c1,c2,c3,c4,c5);

    return 0;
}

扫描二维码,在手机上阅读
收藏
请先 登录 再评论
powered by emlog pro
服务器供应商 景云数据

友情链接
白衣Ink


sitemap