#include<bits/stdc++.h>
using namespace std;
int main(){
while(true){
int temp;
int a[10];
int s=0;
for(int i=0;i<5;i++){
cin>>a[i];
s+=a[i];
}
if(s==0)
break;
if(a[1]-a[0]==a[2]-a[1]){
temp=a[1]-a[0];
for(int i=5;i<10;i++){
a[i]=a[i-1]+temp;
cout<<a[i]<<" ";
}
}
else if(a[2]/a[1]==a[3]/a[2]){
temp=a[2]/a[1];
for(int i=5;i<10;i++){
a[i]=a[i-1]*temp;
cout<<a[i]<<" ";
}
}
cout<<endl;
}
return 0;
}
问题 G: 数列
最新推荐文章于 2024-04-11 19:57:42 发布
