Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
57113 | 安一宸 | 找规律填数字 | C++ | 通过 | 100 | 0 MS | 268 KB | 918 | 2022-08-03 19:24:12 |
#include<bits/stdc++.h> using namespace std; int a,b,c,d,e; int main(){ while(scanf("%d%d%d%d%d",&a,&b,&c,&d,&e)!=EOF){ if(a==0 && b==0 && c==0 && d==0 && e==0){ break; } if((b-a)==(c-b)&&(d-c)==(c-b)&&(d-c)==(e-d)){ int t=b-a; for(int i=1;i<=5;i++){ cout<<e+i*t<<" "; } cout<<endl; } if((b/a)==(c/b)&&(c/b)==(d/c)&&(d/c)==(e/d)&&(b/a)!=1){ int t=b/a; for(int i=1;i<=5;i++){ cout<<e*(int)pow(t,i)<<" "; } cout<<endl; } if(a+b==c&&b+c==d&&c+d==e){ int t1=d,t2=e,s=0; for(int i=6;i<11;i++){ s=t1+t2; t1=t2; t2=s; cout<<s<<" "; } cout<<endl; } } return 0; }