解题思路:
注意事项:
参考代码:
public class a {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt(),NA = sc.nextInt(),NB = sc.nextInt();
int a[] = new int[N];
for (int i = 0; i < NA; i++) {
a[i] = sc.nextInt();
}
for (int i = NA; i < N; i++) {
a[i] = a[i-NA];
}
int b[] = new int[N];
for (int i = 0; i < NB; i++) {
b[i] = sc.nextInt();
}
for (int i = NB; i < N; i++) {
b[i] = b[i-NB];
}
int c = 0,A = 0,B = 0;
for (int i = 0; i < N; i++){
c = a[i]-b[i];
if (c==-2||c==-3||c==5){
A++;
} if (c==2||c==3||c==-5){
B++;
}
}
if (A>B){
System.out.println("A");
}else if (A<B){
System.out.println("B");
}else {
System.out.println("draw");
}
}
}
0.0分
1 人评分
小九九 (C语言代码)浏览:568 |
【蟠桃记】 (C语言代码)浏览:826 |
C语言程序设计教程(第三版)课后习题9.4 (C语言代码)浏览:627 |
C语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:1763 |
C语言程序设计教程(第三版)课后习题3.7 (C++代码)浏览:1024 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:668 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:590 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:806 |
C二级辅导-阶乘数列 (C语言代码)浏览:736 |
剪刀石头布 (C语言代码)浏览:802 |