提交时间:2022-08-03 15:13:20
运行 ID: 56841
#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=b-a; f=5; while(f){ cout<<e+l<<" "; e+=l; f--; } cout<<endl; } 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; }