Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

简单过,(代码后)

Posted by pktop at 2009-07-31 13:59:19 on Problem 2105
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator