Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2915e6a

Browse filesBrowse files
authored
Create 25_sumOfSquare.java
1 parent 03d4b88 commit 2915e6a
Copy full SHA for 2915e6a

File tree

Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
public class Solution {
2+
public boolean judgeSquareSum(int c) {
3+
for (int i = 2; i * i <= c; i++) {
4+
int count = 0;
5+
if (c % i == 0) {
6+
while (c % i == 0) {
7+
count++;
8+
c /= i;
9+
}
10+
if (i % 4 == 3 && count % 2 != 0)
11+
return false;
12+
}
13+
}
14+
return c % 4 != 3;
15+
}
16+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.