c语⾔字符串转成ascii码,c语⾔-显⽰字符串每⼀个字符的ascii
码问题
#include
#include
int main() {
char str[]="";
int i=0;
int count=0;
printf("please input your words:");
scanf("%s",&str);
printf("you have input the words %s\n",str);
printf("you have input the words %c\n",str[1]);
printf("you have input the words %c\n",str[2]);
printf("you have input the words %c\n",str[3]);
int length=strlen(str);
for(i=0;i
int num=str[i];
printf("number %d,",num);
printf("character %c,",str[i]);
printf("i=%d\n",i);
}
ascii共有多少个字符}
>>>>>>>#
这段程序输⼊字符串1234后,会显⽰
you have input the words 1234
you have input the words 2
you have input the words 3
you have input the words 4
number 49,character 1,i=0
number 1,character ,i=1
number 0,character ,i=2
number 0,character ,i=3
我想它能显⽰每个字符的ascii码,求各位⾼⼿指点
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
多个字符串进行ASCII排序
« 上一篇
1、信息在机器中的表示
下一篇 »
发表评论