1 条题解

  • 0
    @ 2025-4-7 21:41:58

    Java :

    import java.util.Scanner;
    public class Main {
    	public static void main(String[] args) {
    		Scanner n = new Scanner(System.in);
    		int a = n.nextInt();
    		int c = 1;
    		for (int i = 1; i <= a; i++) {
    			int s = i * (3 * i - 1) / 2;
    			System.out.print((c++ % 10 != 0) ? s + "\t" : s + "\n");
    		}
    	}
    }
    
    • 1

    信息

    ID
    2160
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者