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:那位大哥替我看一下,明明是对的啊?

Posted by pb128 at 2005-07-15 22:09:43 on Problem 1658
In Reply To:那位大哥替我看一下,明明是对的啊? Posted by:zhangjb at 2005-02-19 00:04:23
#include<stdio.h>
int main()
{long a[20][5],t,d;
 int i,j,n,mark=1;
 scanf("%d",&n);
 for(i=0;i<n;i++)
 for(j=0;j<4;j++)scanf("%ld",&a[i][j]);
 for(i=0;i<n;i++)
 {d=a[i][1]-a[i][0];mark=1;
  for(j=0;j<4;j++)
  {printf("%ld ",a[i][j]);
   if(a[i][j]!=a[i][0]+j*d){mark=0;}}
  if(mark)a[i][4]=a[i][3]+d;
  else a[i][4]=a[i][1]/a[i][0]*a[i][3];
  printf("%ld\n",a[i][4]);
 }
}

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