求解代码
public static void main(String[] args) throws IOException {BufferedReader br new BufferedReader(new InputStreamReader(System.in));PrintWriter out new PrintWriter(new OutputStreamWriter(System.out));String str br.readLine();long n Long.parseLong…