石头剪刀布,模拟
#include "bits/stdc++.h"
using namespace std;
int win[5][5] = {
{0, -1, 1, 1, -1},
{1, 0, -1, 1, -1},
{-1, 1, 0, -1, 1},
{-1, -1, 1, 0, 1},
{1, 1, -1, -1, 0}
};
int main(){
int n,a,b;
cin>>n>>a>>b;
vector A(a);
vector B(b);
for(int i = 0;i cin>>A[i];
}
for(int i = 0;i cin>>B[i];
}
int countA = 0,countB = 0;
for(int i = 0;i int a1 = A[i%a] ,b1 = B[i%b];
if (win[a1][b1] == 1) {
countA++;
} else if (win[a1][b1] == -1) {
countB++;
}
}
cout< return 0;
}
using namespace std;
int win[5][5] = {
{0, -1, 1, 1, -1},
{1, 0, -1, 1, -1},
{-1, 1, 0, -1, 1},
{-1, -1, 1, 0, 1},
{1, 1, -1, -1, 0}
};
int main(){
int n,a,b;
cin>>n>>a>>b;
vector
vector
for(int i = 0;i cin>>A[i];
}
for(int i = 0;i cin>>B[i];
}
int countA = 0,countB = 0;
for(int i = 0;i
if (win[a1][b1] == 1) {
countA++;
} else if (win[a1][b1] == -1) {
countB++;
}
}
cout<
}
全部评论
相关推荐