POJ 1658 Eva's Problem

来源:互联网 发布:激战2人类男捏脸数据 编辑:程序博客网 时间:2024/04/27 07:31

这题注意判断。。不要写连等。。WA了一次。。

#include <cstdio>using namespace std;int main(){int nCase;scanf("%d",&nCase);while(nCase--){int a,b,c,d,e;scanf("%d%d%d%d",&a,&b,&c,&d);if(b-a==c-b&&c-b==d-c)e=d+d-c;else e=d*d/c;printf("%d %d %d %d %d\n",a,b,c,d,e);} return 0;}