/*
*@author: percation
*#time:2021.04.21
*/
#include <bits/stdc++.h>
using namespace std;
map<int,int> mp;
const int N = 20;
int a[N][N];
bool vis[N];
int main(){
mp[6] = 10000;
mp[7] = 36;
mp[8] = 720;
mp[9] = 360;
mp[10] = 80;
mp[11] = 252;
mp[12] = 108;
mp[13] = 72;
mp[14] = 54;
mp[15] = 180;
mp[16] = 72;
mp[17] = 180;
mp[18] = 119;
mp[19] = 36;
mp[20] = 306;
mp[21] = 1080;
mp[22] = 144;
mp[23] = 1800;
mp[24] = 3600;
int visx,visy;
for(int i = 0; i < 3; i++){
for(int j = 0; j < 3; j++){
cin >> a[i][j];
vis[a[i][j]]++;
if(a[i][j] == 0){
visx = i;
visy = j;
}
}
}
for(int i = 0; i <= 9; i++){
if(!vis[i]){
a[visx][visy] = i;
}
}//将可见的数字由0变为它原本的数字。
int x,y;
for(int i = 0; i < 3; i++){
cin >> x >> y;
cout << a[x - 1][y - 1] << endl;
}
int dir;
cin >> dir;
int sum = 0;
if(dir >= 1 && dir <= 3){
for(int j = 0; j < 3; j++)
sum += a[dir - 1][j];
}
else if(dir > 3 && dir <= 6){
for(int i = 0; i < 3; i++){
sum += a[i][dir - 4];
}
}
else if(dir == 7){
sum += a[0][0] + a[1][1] + a[2][2];
}
else{
sum += a[0][2] + a[1][1] + a[2][0];
}
cout << mp[sum] << endl;
return 0;
}
L1-072 刮刮彩票 (20 point(s))
最新推荐文章于 2022-12-16 00:02:18 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)