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 19860603 at 2004-12-20 14:05:33 on Problem 1658
#include <stdio.h>
#include <math.h>
void main(){
	int a[6];
	int i,j,t;
	scanf("%d\n",&t);
    while(t>=0&&t<=20){
		for(j=1;j<=t;j++){
			for(i=0;i<=3;i++)
		        scanf("%d ",&a[i]);           
			if(a[3]-a[2]==a[2]-a[1])
		        a[4]=2*a[3]-a[2];
	        else if(a[3]/a[2]==a[2]/a[1])
				a[4]=a[3]*a[3]/a[2];
            for(i=0;i<=4;i++){
                printf("%d ",a[i]);
			}
			printf("\n");			
		}
		if(j=t+1) break;			
	}
}

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