codeforces 259-B. Little Elephant and Magic Square(数学)
来源:互联网 发布:centos ftp没找到 编辑:程序博客网 时间:2024/06/05 11:52
http://codeforces.com/problemset/problem/259/B
九宫格里正中间的数等于任意旁边每一对数之和的一半。
#include<iostream>using namespace std;int main(){ int n; cin>>n; while(n--) { int a[5][5]; for(int i=0;i<3;i++) for(int j=0;j<3;j++) cin>>a[i][j]; a[1][1]=(a[0][1]+a[2][1])/2; a[0][0]=3*a[1][1]-(a[0][1]+a[0][2]); a[2][2]=3*a[1][1]-(a[0][2]+a[1][2]); for(int i=0;i<3;i++) { for(int j=0;j<2;j++) cout<<a[i][j]<<" "; cout<<a[i][2]<<endl; } } return 0;}
阅读全文
0 0
- codeforces 259-B. Little Elephant and Magic Square(数学)
- B. Little Elephant and Magic Square
- Codeforces 220B(Little Elephant and Array)
- Codeforces 220B Little Elephant and Array
- CodeForces 220B Little Elephant and Array
- CodeForces 204B - Little Elephant and Cards
- codeforces 204B- Little Elephant and Cards
- codeforces 221B Little Elephant and Numbers
- Codeforces-258B Little Elephant and Elections
- Codeforces 258B Little Elephant and Elections
- Codeforces 204B Little Elephant and Cards
- Codeforces 258B - Little Elephant and Elections
- CodeForces 711B. Chris and Magic Square(水题)
- CodeForces 711B Chris and Magic Square(找规律)
- Codeforces 711B Chris and Magic Square
- Codeforces 711B Chris and Magic Square
- CodeForces 711B - Chris and Magic Square
- Codeforces 711B- Chris and Magic Square
- Python脚本实现树莓派对MPU6050的数据读取
- PAT 1049. Counting Ones (30)
- 深度学习系列教程
- 部分开发工具激活
- Android三种姿势带你玩转360度全景图功能
- codeforces 259-B. Little Elephant and Magic Square(数学)
- 美团编程题
- 明远智睿IMX6Q Android4.4.2移植USBWIFI(RTL8188EUS)
- java中volatile关键字的含义
- 纯js实现简单的汉语转字母
- hdu1878-判断欧拉回路-欧拉回路
- union的特殊用途
- Android多渠道打包汇总(二)—— 使用AS进行签名打包
- GStree介绍