北大1658题
来源:互联网 发布:重庆大学网络继续教育 编辑:程序博客网 时间:2024/04/26 09:12
题目连接:http://acm.pku.edu.cn/JudgeOnline/problem?id=1658
#include <iostream>
using namespace std;
int main()
{
freopen("in.txt","r",stdin);
int a[5],d,q;
int i,t;
cin >> t;
while(t--)
{
for(i = 0;i < 4;++i)
cin >> a[i];
if(a[1] % a[0] == 0)
{
q = a[1] / a[0];
if(a[2] == a[1] * q && a[3] == a[2]*q)
a[4] = a[3] * q;
d = a[1] - a[0];
if(a[2] == a[1] + d && a[3] == a[2] + d)
a[4] = a[3] + d;
}
else
{
d = a[1] - a[0];
if(a[2] == a[1] + d && a[3] == a[2] + d)
a[4] = a[3] + d;
}
cout << a[0];
for(i = 1;i < 5;++i)
cout << ' ' << a[i];
cout << endl;
}
return 0;
}
- 北大1658题
- 北大1002题
- 北大1503题
- 北大1519题
- 北大1517题
- 北大1068题
- 北大2039题
- 北大1484题
- 北大2590题
- 北大2608题
- 北大1047题
- 北大1102题
- 北大1316题
- 北大3268题
- 北大2394题
- 北大2895题
- 北大2109题
- 北大1328题
- Web技术发展史话(1). 客户端的萌芽和演进 (转载)
- 宏信科技
- discuz6.0常用sql语句整理
- mysql中UNIX_TIMESTAMP()函数和php中time()函数的区别
- 解决ubuntu sudo 命令无效的方法
- 北大1658题
- 百度”阿拉丁“计划——看上去很美
- 详解modprobe的用法
- Oracle如何附加数据库
- 北大1166题
- ubuntu8.04中配置java+tomcat+eclipse/MyEclipse开发环境(更新)
- 一个串口上位机程序
- cookies你应该知道的
- VC实现将图片转换为数组