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

我快疯了,我在linux里面用g++运行很正常啊。莫非有什么变态的数据?

Posted by amazingjxq at 2008-01-09 22:47:39 on Problem 2105
#include "iostream"
#include "vector"
using namespace std;
using std::vector;
int main()
{
    int n,pow,tmp=0;
	char bit;
	vector<int> res;
	cin>>n;
	for(int i=0;i!=n;i++){
		for(int count=0;count!=32;count++){
			if(count%8==0){
				if(count)res.push_back(tmp);
				pow=128;
				tmp=0;
			}
			cin>>bit;
			if(bit!='0'&&bit!='1')continue;
			tmp+=(bit-48)*pow;
			pow/=2;
		}
		res.push_back(tmp);
	}
	for(vector<int>::size_type idx=0;idx!=res.size();idx++){
		cout<<res[idx]<<".";
		if((idx+1)%4==0){
			cout<<"\b\n";
		}
	}
    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