PAT Basic Level 1005 继续3n+1猜想

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

/**
 * author:djch
 * date:2021/5/25
 *
 * @author djch*/
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int k = scanner.nextInt();
        scanner.nextLine();  //nextInt不带换行符
        int[] nums = new int[k];
        HashSet hashSet = new HashSet();  //创建哈希集,保存遇到的数字
        for(int i = 0; i

 

你可能感兴趣的:(PAT Basic Level 1005 继续3n+1猜想)