| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
我也来晒晒代码#include<iostream>
using namespace std;
int map[8]={1,2,4,8,16,32,64,128};
int main()
{
char str[35];
int t,a[4];
cin>>t;
while(t--)
{
cin>>str;
memset(a,0,sizeof(a));
for(int i=31;i>=0;i--)
{
int p=i/8;
int q=(7-i%8);
a[p]+=(str[i]-'0')*map[q];
}
for(int i=0;i<4;i++)
if(i==0)cout<<a[i];
else cout<<"."<<a[i];
cout<<endl;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator