随笔-65  评论-6  文章-0  trackbacks-0
 1 #include<stdio.h>
 2 #include<string.h>
 3 //inline void scan(int &x){
 4 //    char ch;
 5 //    while(ch=getchar(),ch<'0'||ch>'9');x=ch-'0';
 6 //    while(ch=getchar(),ch>='0'&&ch<='9')x=10*x+ch-'0';
 7 // }
 8 int main(){
 9 //    #ifndef ONLINE_JUDGE
10 //    freopen("in.txt","r",stdin);
11 //    #endif
12     int j,pos,num,t;
13     while (scanf("%d",&t)!=EOF){
14         t+=2;
15         pos=num=0;
16         while (t){
17             t>>=1;
18             pos++;
19         }
20         for(j=31;j>=0;j--){
21             if(j>=pos)
22                 num+=1<<(j%8);
23             if(j==0||j%8==0){
24                 printf("%d",num);
25                 num=0;
26                 if(j>0)
27                     printf(".");
28             }
29         }
30         printf("\n");
31     }
32     return 0;
33 }
34 
posted on 2012-05-20 16:27 Leo.W 阅读(166) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理