提交时间:2022-08-03 15:22:20

运行 ID: 56852

#include<bits/stdc++.h> using namespace std; int a,b,c,d,e,f,t,l; int main(){ while(cin>>a&&a){ cin>>b>>c>>d>>e; if(e-d==d-c&&d-c==c-b&&c-b==b-a){ l=e-d; if(l==1) cout<<e+1<<" "<<e+2<<" "<<e+3<<" "<<e+4<<" "<<e+5<<" "; else cout<<e+l<<" "<<e+2*l<<" "<<e+3*l<<" "<<e+4*l<<" "<<e+5*l<<" "; } if(e/d==d/c&&d/c==c/b&&c/b==b/a){ l=b/a; for(int i=1;i<=5;i++){ cout<<e*l<<" "; e*=l; } cout<<endl; } if(e==d+c&&d==c+b&&c==b+a){ t=d; for(int i=1;i<=5;i++){ e+=t; cout<<e<<" "; t=e-t; } cout<<endl; } } return 0; }