题目描述
代码实现
package com.atguigu.lanqiao;import java.util.Scanner;public class Main {public static void main(String[] args) {int sum=0;for (int i = 1; i <= 10000; i++) {String a=i+"";String b=(long)(Math.pow(i,3))+"";String c=b.substring(b.length()-a.length());if(c.equals(a)){sum++;}}System.out.println(sum);}}
答案
36