标签:des style blog io color os ar for sp
1 #include <stdio.h> 2 3 int main(){ 4 int number; 5 char result[20]; 6 int length; 7 int i; 8 9 while((scanf("%d",&number))!=EOF){ 10 i=0; 11 while(number){ 12 result[i]=number%2+‘0‘; 13 i++; 14 number/=2; 15 } 16 length=i; 17 18 for(i=length-1;i>=0;i--) 19 printf("%c",result[i]); 20 21 printf("\n"); 22 } 23 24 return 0; 25 }
标签:des style blog io color os ar for sp
原文地址:http://www.cnblogs.com/zqxLonely/p/4058173.html