标签:来源 highlight public blank ref 题目 param turn 分享
简单粗暴
public class Solution { /* * @param : the given number * @return: whether whether there‘re two integers */ public boolean checkSumOfSquareNumbers(int n) { int max = (int)Math.sqrt(n) + 1; for(int i=0; i<max; i++){ for(int j=0; j<max; j++){ if(i*i + j*j == n) return true; } } return false; } };
题目来源: http://www.lintcode.com/zh-cn/problem/check-sum-of-square-numbers/
标签:来源 highlight public blank ref 题目 param turn 分享
原文地址:http://www.cnblogs.com/cc11001100/p/7898182.html