题解 | #字符转ASCII码#

字符转ASCII码

https://www.nowcoder.com/practice/93f4d05a02d9468db424ed4316bfc8fd

#include<stdio.h>
int main()
{
    int a;
    scanf("%c",&a);
    printf("%hhd",a);//%hhd对应char,%hd对应short,%d对应int,%ld对应long,%lld对应long long
    return 0;
}

总结:

%hhd对应char,

%hd对应short,

%d对应int,

%ld对应long,

%lld对应long long

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务