1234567891011121314151617181920212223 |
-
- /**
- * Write a description of class FizzBuzzMain here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class FizzBuzzMain
- {
- public String main(int y)
- {
- if (y % 3 == 0 && y % 5 == 0){
- return "FizzBuzz";
- }else if (y % 3 == 0){
- return "Fizz";
- } else if (y % 5 ==0){
- return "Buzz";
- }else {
- return "2";
- }
- }
- }
|