Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
56839 | 姜李烨 | 找规律填数字 | C++ | Wrong Answer | 0 | 0 MS | 248 KB | 756 | 2022-08-03 15:12:36 |
#include<bits/stdc++.h> using namespace std; int a,b,c,d,e,t,x,y[10]; int check(int a,int b,int c,int d,int e){ if(b-a==c-b==d-c==e-d){ t=b-a; return 1; } if(b%a+b/a==c%b+c/b&&e/d+e%d==c/b+c%b){ t=b%a+b/a; return 2; } if(c==a+b&&e==c+d){ t=0; return 3; } } int main(){ while(cin>>a>>b>>c>>d>>e&&a&&b&&c&&d&&e){ if(check(a,b,c,d,e)==1){ x=e; for(int i=1;i<=5;i++){ x+=t; cout<<x<<' '; } cout<<endl; } if(check(a,b,c,d,e)==2){ x=e; for(int i=1;i<=5;i++){ x*=t; cout<<x<<' '; } cout<<endl; } if(check(a,b,c,d,e)==3){ y[1]=d,y[2]=e; for(int i=3;i<=8;i++){ y[i]=y[i-2]+y[i-1]; cout<<y[i]<<' '; } cout<<endl; } } return 0; }