题目: 解法 //前缀和算法+hash表 class Solution { public: int subarraysDivByK(vector<int>& A, int K) { int res=0; int sum=0; unordered_map<int,int> hash = {{0,1}};//考虑自身被整除的情况,神操作,合并了自身被整除和不被整除两种情况 for(int num:A){ sum += num; int module = (sum % K + K
字符输入 Scanner scan = new Scanner(System.in); char ch = scan.next().charAt(0); 车到路口例 package Chapter3_2; import java.util.Scanner; public class Chapter3_2 { public static void main(String[] args) { // TODO Auto-generated me
import java.util.Scanner; public class Job{ public static void main(String[] args){ Scanner scanner = new Scanner(System.in); System.out.print("请输入年龄:age=");//年龄大于60可以退休,小于60不可以退休 int age= scanner.nextInt(); if(age>60) System.out.print("