迷之错误,没看懂,想要循环的话利用余数的特点就可以了,完全不用这么麻烦。
```c
#include<iostream>
using namespace std;
int judge[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,Na,Nb;
cin>>N>>Na>>Nb;
int *A=new int[Na];
int *B=new int[Nb];
for(int i=0;i<Na;i++)
cin>>A[i];
for(int i=0;i<Nb;i++)
cin>>B[i];
int score_A=0;
int score_B=0;
for(int i=0;i<N;i++)
{
if(judge[A[i%Na]][B[i%Nb]]==1)
score_A++;
else if(judge[A[i%Na]][B[i%Nb]]==-1)
score_B++;
}
cout<<score_A<<' '<<score_B;
return 0;
}
```
by huangchao @ 2019-08-18 22:30:12