Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
看看有什么区别??#include<stdio.h> void main() { long int a,b,c,d; int i,n; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%d%d%d",&a,&b,&c,&d); if((b-a)==(c-b)&&(c-d)==(d-c)) printf("%d %d %d %d %d\n",a,b,c,d,2*d-c); else printf("%d %d %d %d %d\n",a,b,c,d,(d*d)/c); } } #include<iostream> using namespace std; int main() { long a[4]; int n; long d; cin>>n; for(int i =1; i<=n; i++) { cin>>a[0]>>a[1]>>a[2]>>a[3]; if((a[1]-a[0]==a[2]-a[1])&&(a[3]-a[2]==a[2]-a[1])) cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<a[3]+a[2]-a[1]<<endl; else cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<a[3]*a[1]/a[0]<<endl; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator