解题思路:
注意事项:
参考代码:
import java.math.BigInteger;
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
BigInteger a=input.nextBigInteger(),b=input.nextBigInteger();
if(a.compareTo(new BigInteger("1"))==0&&b.compareTo(new BigInteger("1"))==0){
System.out.println(1);
return;
}
BigInteger c=a.mod(new BigInteger("2"));
BigInteger d=b.mod(new BigInteger("2"));
if(c.compareTo(d)==0){
System.out.println(a.multiply(b).subtract(new BigInteger("1")));
}else {
System.out.println(1);
}
return;
}
}
最后
以上就是紧张秀发最近收集整理的关于蓝桥杯 java矩阵翻银币_[蓝桥杯][2014年第五届真题]矩阵翻硬币 (Java代码)的全部内容,更多相关蓝桥杯内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复