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

为什么 Output Limit Exceeded,求助,附代码

Posted by 1100011085 at 2012-05-27 13:13:03 on Problem 2105
#include<stdio.h>
#include<string.h>
int jj(int a[])
{
	return a[0]*128+a[1]*64+a[2]*32+a[3]*16+a[4]*8+a[5]*4+a[6]*2+a[7]*1;
}
int main()
{
	int n;
	scanf("%d",&n);
	int i,t,ii;
	char c[30];
	int d[10];
	gets(c);
	int q,w,e,r;
	for(ii=0;ii<n;ii++)
	{
		gets(c);
		for(i=0;i<8;i++)
		{
			d[i]=c[i]-48;
		}
		q=jj(d);
		for(i=8;i<16;i++)
		{
			d[i-8]=c[i]-48;
		}
		w=jj(d);
		for(i=16;i<24;i++)
		{
			d[i-16]=c[i]-48;
		}
		e=jj(d);
		for(i=24;i<32;i++)
		{
			d[i-24]=c[i]-48;
		}
		r=jj(d);
		printf("%d.%d.%d.%d\r\n",q,w,e,r);
	}
	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