赞
踩
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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。