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

Re:output limited exceed

Posted by LIBAI at 2004-12-26 10:40:47 on Problem 1658
In Reply To:output limited exceed Posted by:90401531 at 2004-12-23 17:47:42
> #include <stdio.h>
> void main(){
#include <stdio.h>
void main(){
    int n,a[5];
	scanf("%d",&n);//*最好是有换行符
    while(n>=0&&n<=20){//*这个判断可以不要
        for(int j=1;j<=n;j++){
            for(int i=0;i<4;i++)
	            scanf("%d",&a[i]);//*好像是要有空格的scanf("%d ",&a[i]);傅完值后最好是在循环外面加上换行符
			if((a[0]+a[2]==2*a[1])&&(a[1]+a[3]==2*a[2]))
				a[4]=2*a[3]-a[2];
			else if((a[0]*a[2]==a[1]*a[1])&&(a[1]*a[3]==a[2]*a[2])&&(a[1]%a[0]==0))//*(a[1]%a[0]==0)可以不要
				a[4]=a[3]*a[3]/a[2];
			else break;//*也可以不要
            for(i=0;i<=4;i++)
	            printf("%d ",a[i]);
			    printf("\n");//*做完第一次循环之后要接着复制scanf("%d\n",&n);否则就会一直以上一次夫得n值循环下去,因为你第一次赴得n值符合要求他就会一直循环下去,最终是提交的那个答案
		}
	}
}


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