-
C语言丨输出字符的ASCII码
2025-11-15 16:30:52
从键盘输入一个字符,按规定格式输出这个字符及它的ASCII码。例如:
输入 A
输出 “The ASCII of 'A' is 65”.
#include
int main()
{
char a;
scanf("%c",&a);
printf("\"The ASCII of '");
printf("%c",a);
printf("' is %d\".\n",(int)a);
return 0;
}
从键盘输入一个字符,按规定格式输出这个字符及它的ASCII码。例如:
输入 A
输出 “The ASCII of 'A' is 65”.
#include
int main()
{
char a;
scanf("%c",&a);
printf("\"The ASCII of '");
printf("%c",a);
printf("' is %d\".\n",(int)a);
return 0;
}
友情链接: Copyright © 2022 清风客栈网游活动中心 All Rights Reserved.