蓝桥杯:特别数的和java(1245)


import java.util.*;

public class specialmath {
    public static void main(String[]args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = 0, sum = 0;

        for (int i = 1; i <= n; i++) {
            String str = Integer.toString(i);

            for (int j = 0; j 

问:为什么单纯嵌套循环用取余再除不成功??

 

你可能感兴趣的:(蓝桥杯,java,职场和发展)