01 入门基础
PAT入门实践!
是聪聪黄吖
道阻且长,行则将至!
展开
-
06 字符串处理【PAT A1077】Kuchiguse
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class A1077 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N原创 2022-02-22 16:18:18 · 96 阅读 · 0 评论 -
06 字符串处理【PAT A1073】Scientific Notation
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class A1073 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String原创 2022-02-21 19:38:28 · 91 阅读 · 0 评论 -
06 字符串处理【PAT A1061】Dating
1 题目2 代码import java.util.Scanner;public class A1061 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String oneStr = sc.next(); String twoStr = sc.next(); String threeStr = sc.next();原创 2022-02-20 18:34:08 · 232 阅读 · 0 评论 -
06 字符串处理【PAT A1035】Password
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;import java.util.ArrayList;public class A1035 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader原创 2022-02-22 12:14:52 · 213 阅读 · 0 评论 -
06 字符串处理【PAT A1005】Spell It Right
1 题目2 代码import java.util.Scanner;public class A1005 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String N = sc.next(); String[] ch = {"zero", "one", "two", "three", "four", "five", "six",原创 2022-02-22 11:43:42 · 193 阅读 · 0 评论 -
06 字符串处理【PAT A1001】A+B Format
1 题目2 代码import java.util.Scanner;public class A1001 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int B = sc.nextInt(); int sum = Math.abs(A + B); Str原创 2022-02-22 08:51:24 · 93 阅读 · 0 评论 -
06 字符串处理【PAT B1048】数字加密
1 题目2 代码import java.util.Scanner;public class B1048 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A = sc.next(); String B = sc.next(); String res = ""; int m = A.len原创 2022-02-21 20:27:55 · 168 阅读 · 0 评论 -
06 字符串处理【PAT B1031】查验身份证
1 题目2 代码import java.util.Scanner;public class B1031 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] weight = {7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2}原创 2022-02-20 14:04:37 · 260 阅读 · 0 评论 -
06 字符串处理【PAT B1024】科学计数法
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class B1024 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String原创 2022-02-21 19:34:15 · 145 阅读 · 0 评论 -
06 字符串处理【PAT B1021】个位数统计
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class B1021 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String原创 2022-02-19 17:40:14 · 182 阅读 · 0 评论 -
06 字符串处理【PAT B1017】A除以B
1 题目2 代码2.1 第一版import java.io.BufferedReader;import java.io.InputStreamReader;import java.math.BigInteger;public class B1017 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStr原创 2022-02-25 18:57:08 · 185 阅读 · 0 评论 -
06 字符串处理【PAT B1014】福尔摩斯的约会
1 题目2 代码import java.util.Scanner;public class B1014 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String oneStr = sc.next(); String twoStr = sc.next(); String threeStr = sc.next();原创 2022-02-20 18:29:31 · 148 阅读 · 0 评论 -
06 字符串处理【PAT B1009】说反话
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class B1009 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String原创 2022-02-20 14:13:30 · 213 阅读 · 0 评论 -
06 字符串处理【PAT B1006】换个格式输出整数
1 题目2 代码import java.util.Scanner;public class B1006 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int B = n / 100; int S = n / 10 % 10; int G = n % 10原创 2022-02-19 15:16:36 · 66 阅读 · 0 评论 -
06 字符串处理【PAT B1003】我要通过
1 题目2 代码import java.util.HashMap;import java.util.Map;import java.util.Scanner;public class B1003 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 0; i &l原创 2022-02-19 13:55:21 · 82 阅读 · 0 评论 -
06 字符串处理【PAT B1002】写出这个数
1 题目2 代码import java.util.Scanner;public class B1002 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] str = sc.nextLine().toCharArray(); sc.close(); int num = 0; String[原创 2022-02-16 12:33:32 · 187 阅读 · 0 评论 -
05 进制转换【PAT A1058】A+B in Hogwarts
1 题目2 代码import java.util.Scanner;public class A1058 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] input01 = sc.next().split("\\."); String[] input02 = sc.next().split("\\.");原创 2022-02-19 17:26:42 · 122 阅读 · 0 评论 -
05 进制转换【PAT A1027】Colors in Mars
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class A1027 { static int num = 0; static int[] arrRGB = new int[6]; public static void main(String[] args) throws Exception { BufferedReader br = new B原创 2022-02-19 17:13:56 · 96 阅读 · 0 评论 -
05 进制转换【PAT A1019】General Palindromic Number
1 题目2 代码2.1 第一版import java.util.Scanner;public class A1019 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int b = sc.nextInt(); sc.close(); String res原创 2022-02-19 11:17:08 · 145 阅读 · 0 评论 -
05 进制转换【PAT B1037】在霍格沃滋找零钱
1 题目2 代码import java.util.Arrays;import java.util.Scanner;public class B1037 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] input01 = sc.next().split("\\."); String[] input02 = sc.n原创 2022-02-19 09:47:41 · 129 阅读 · 0 评论 -
05 进制转换【PAT B1022】D进制的A+B
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class B1022 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String原创 2022-02-18 19:07:08 · 173 阅读 · 0 评论 -
03 图形输出【PAT A1031】Hello World for U
1 题目2 代码import java.util.Scanner;public class A1031 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.nextLine(); int n1 = 0, n2 = 0, flag = 1; for (int i = 3; i <=原创 2022-02-18 16:20:51 · 210 阅读 · 0 评论 -
03 图像输出【PAT B1036】跟奥巴马一起编程
1 题目2 代码import java.util.Scanner;public class B1036 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String str = sc.next(); for (int i = 0; i < N; i++) {原创 2022-02-17 21:32:54 · 136 阅读 · 0 评论 -
03 图像输出【PAT B1027】打印沙漏
1 题目2 代码import java.util.Scanner;public class B1027 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String str = sc.next(); int n = (int) Math.sqrt((N + 1) / 2.原创 2022-02-18 13:34:07 · 116 阅读 · 0 评论 -
02 元素查找【PAT B1041】考试座位号
1 题目2 代码import java.util.Scanner;public class B1041 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long[] id = new long[N]; int[] examSeat = new int[N];原创 2022-02-14 20:43:38 · 181 阅读 · 0 评论 -
02 元素查找【PAT A1036】Boys VS Girls
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class A1036 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N原创 2022-02-17 21:01:48 · 154 阅读 · 0 评论 -
02 元素查找【PAT B1028】人口普查
1 题目2 代码2.1 第一版import java.util.ArrayList;import java.util.Collections;import java.util.Comparator;import java.util.Scanner;public class B1028 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int原创 2022-02-15 11:42:38 · 229 阅读 · 0 评论 -
02 元素查找【PAT A1011】World Cup Betting
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class A1011 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[原创 2022-02-16 19:28:55 · 76 阅读 · 0 评论 -
02 元素查找【PAT A1006】Sign In and Sign Out
1 题目2 代码import java.text.DateFormat;import java.text.SimpleDateFormat;import java.util.Date;import java.util.Scanner;public class A1006 { public final static DateFormat df = new SimpleDateFormat("HH:mm:ss"); public static void main(String[原创 2022-02-17 19:06:11 · 90 阅读 · 0 评论 -
02 元素查找【PAT B1004】成绩排名
1 题目2 代码import java.util.Scanner;public class B1004 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String gStudentName = ""; String bStudentName = "";原创 2022-02-14 20:59:07 · 69 阅读 · 0 评论 -
01 牛刀小试【PAT A1065】A+B and C(64bit)
1 题目2 代码import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;public class A1065 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader原创 2022-02-15 18:11:36 · 505 阅读 · 0 评论 -
01 牛刀小试【PAT A1046】Shortest Distance
1 题目2 代码import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.Arrays;public class A1046 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedRea原创 2022-02-15 17:39:58 · 189 阅读 · 0 评论 -
01 牛刀小试【PAT A1042】Shuffling Machine
1 题目2 代码import java.util.Arrays;import java.util.Scanner;public class A1042 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); int[] shuffle = new int[55]; int[]原创 2022-02-14 19:13:50 · 183 阅读 · 0 评论 -
01 牛刀小试【PAT A1009】Product of Polynomials
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class A1009 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String原创 2022-02-16 11:23:33 · 199 阅读 · 0 评论 -
01 牛刀小试【PAT A1002】A+B for Polynomials
1 题目2 代码import java.io.BufferedReader;import java.io.InputStreamReader;public class A1002 { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String原创 2022-02-16 11:04:46 · 175 阅读 · 0 评论 -
01 牛刀小试【PAT B1046】划拳
1 题目2 代码import java.util.Scanner;public class B1046 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int x_num = 0; int y_num = 0; for (int i = 0; i <原创 2022-02-11 11:15:20 · 268 阅读 · 0 评论 -
01 牛刀小试【PAT B1032】挖掘机技术哪家强
1 题目2 代码import java.util.*;public class B1032 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int sch = 0; int grade = 0; int[] arr = new int[N + 1]; /原创 2022-03-03 10:04:09 · 124 阅读 · 0 评论 -
01 牛刀小试【PAT B1026】程序运行时间
1 题目2 代码import java.util.Scanner;public class B1026 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int C1 = sc.nextInt(); int C2 = sc.nextInt(); int ans = (int) Math.round((C2 - C1)原创 2022-02-10 21:45:33 · 240 阅读 · 0 评论 -
01 牛刀小试【PAT B1018】锤子剪刀布
1 题目2 代码import java.util.Scanner;public class B1018 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); String x = ""; String y = ""; int[] xArray = new int原创 2022-02-11 14:22:43 · 168 阅读 · 0 评论 -
01 牛刀小试【PAT B1016】部分A+B
1 题目2 代码import java.util.Scanner;public class B1016 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int A = sc.nextInt(); int DA = sc.nextInt(); int B = sc.nextInt(); int DB =原创 2022-02-10 20:52:37 · 205 阅读 · 0 评论