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

40题,庆祝下 发一个代码

Posted by bupt_chen at 2008-07-03 20:55:45 on Problem 2105
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n;
    cin >> n;
    while(n--)
    {
        string str;
        cin >> str;
        int result=0;
        for( int j=0;j<4;j++)
        {
            result = 0; 
            for(int i=0;i!=8;i++)
            {
                result*=2;    
                result+=(str[i+8*j]-'0');       
            }
            cout << result ;
            if(j!=3) cout << ".";      
        }
        cout << endl;
    }
    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