Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ public static String getDayTitle(int dayIndex) {
return "Sunday";

default:
return "Error";
return "error";
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
public class Task8 {
public static int calculateSum(int N) {
int result = 0;
int i;
for (i = N; 2 * N >= i; i++)
result = (int) (i + Math.pow((2 * N), 2));

for (int i = N; 2 * N >= i; i++)
result+= i*i;
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ public class Task9 {

public static boolean isPowerOfThree(int n) {

if (n < 1){
if (n <= 1){
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 is 3^0 - and due to given condition you'll return false

return false;
}

while (n % 3 == 0) {
while (n>1 && (n % 3) == 0) {
n = n / 3;
}
return true;
return n == 1;
}
}