当前位置: 代码迷 >> C语言 >> 一个敏感的问题
  详细解决方案

一个敏感的问题

热度:128   发布时间:2005-04-25 21:52:00.0
一个敏感的问题
杂把字符的ASCII值用二进制显示出来?
搜索更多相关的解决方案: 敏感  

----------------解决方案--------------------------------------------------------

//把字符的ASCII值用二进制显示出来? #include <stdio.h>

#define MAXSIZE 8

void shou_ascii();

void shou_ascii() { char c; int i=0; int arry[MAXSIZE]={0}; printf("please enter the character:\n"); c=getchar(); fflush(stdin); while(c>0) { arry[i]=c%2; c=c/2; i++; } i--; printf("the ascii output is :\n"); for(;i>=0;i--) printf("%d",arry[i]); printf("\n"); }

void main() { shou_ascii(); }


----------------解决方案--------------------------------------------------------
谢谢
----------------解决方案--------------------------------------------------------
  相关解决方案