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> #include <cmath> using namespace std; int main () { char str[50]={0}; int id[5]={0}; int n,i,k=0; cin>>n; getchar(); while(n--) { memset(str,0,sizeof(str)); memset(id,0,sizeof(id)); gets(str); for(i=0;i<32;i++) id[i/8]+=(str[i]-'0')*(int)pow(double(2),7-i%8); cout<<id[0]<<"."<<id[1]<<"."<<id[2]<<"."<<id[3]<<endl; } system("pause"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator