-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6578 from diegoasr23/main
Reto #0 - Java
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
Retos/Reto #0 - EL FAMOSO FIZZ BUZZ [Fácil]/java/diegoasr23.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
public class diegoasr23 { | ||
public static void main(String[] args) { | ||
new diegoasr23().reto01(1); | ||
} | ||
|
||
void reto01(int i) { | ||
if ((i % 3 == 0) && (i % 5 == 0)) | ||
System.out.println("FlizzBuzz"); | ||
else if (i % 5 == 0) | ||
System.out.println("Buzz"); | ||
else if (i % 3 == 0) | ||
System.out.println("Flizz"); | ||
if (i == 100) | ||
return; | ||
reto01(i + 1); | ||
} | ||
|
||
} |