#include <stdio.h> #include <string.h> void check(char c){ int a[8]={0}; int b=c; memset(a,0,sizeof(a));//此函数在string.h内部 int order=1; int count=0; for(int i=0;i<7;i++){ int temp=(b/order)%2; order*=2; a[i]=temp; if(temp==1)count++; } if(count%2==0){ a[7]=1; }else{ a[7]=0; } for(int i=7;i>=0;i--){ printf("%d",a[i]); } } int main() { char c; while(scanf("%c",&c)!=EOF){ if(c!='\n'&&c!=' '){ check(c); printf("\n"); } } return 0; }