-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution by Phan Dinh The #68
base: master
Are you sure you want to change the base?
Conversation
int additionFor5 = 0; | ||
int selectedAddition = 1; | ||
|
||
for(int i=1; i<101;) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing around operators = <
if (i%5 == 0) | ||
System.out.println("Buzz"); | ||
|
||
additionFor3 = 3-(i%3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing around operators & parentheses - % ()
additionFor3 = 3-(i%3); | ||
additionFor5 = 5-(i%5); | ||
|
||
selectedAddition = additionFor3 > additionFor5 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, this looks like a smart solution that jumps to the nearest multiple of 3 or 5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting solution
Also I as shown in the videos, please use a separate branch |
Please review for me.
Thanks.