
PAT
weixin_38918663
这个作者很懒,什么都没留下…
展开
-
1015 Reversible Primes (20分)
Areversible primein any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a prime.Now given any two positive integersN(<105)...原创 2020-12-04 10:21:06 · 118 阅读 · 0 评论 -
1010 Radix (25分)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer isyes, if 6 is a decimal number and 110 is a binary number.Now for any pair of positive integersN1andN2, your task is to find the radix of ...原创 2020-12-01 11:55:25 · 103 阅读 · 0 评论 -
十进制,十六进制转二进制
import java.util.Scanner;public class ListTest { public static void main(String[] args) { Scanner in = new Scanner(System.in); String num1 = in.next(); changeTo2Binary(16, num1)) } private static int[] radixs = new.原创 2020-11-25 20:24:57 · 151 阅读 · 0 评论 -
PAT优化输入超时
1007Maximum Subsequence Sum(25分)Scanner输入效率太低,改用BufferedReader,再将字符串转化为intBufferedReader sc = new BufferedReader(new InputStreamReader(System.in));import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;publi..原创 2020-11-23 10:29:08 · 164 阅读 · 0 评论