Created
May 5, 2014 06:47
-
-
Save DavyLin/4528e07165717178070a to your computer and use it in GitHub Desktop.
Revisions
-
DavyLin renamed this gist
May 5, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
DavyLin created this gist
May 5, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ public class FizzTest { public static void main(String[] args) { String string = ""; String[] nums = new Scanner(System.in).next().split(","); for (int i = 1; i <= 100; i++) { if (String.valueOf(i).indexOf(nums[0]) != -1) { string += "Fizz"; } else { if (i % Integer.parseInt(nums[0]) == 0) { string += "Fizz"; } if (i % Integer.parseInt(nums[1]) == 0) { string += "Buzz"; } if (i % Integer.parseInt(nums[2]) == 0) { string += "Whizz"; } else if (i % Integer.parseInt(nums[0]) != 0 && i % Integer.parseInt(nums[1]) != 0 && i % Integer.parseInt(nums[2]) != 0) { string += i; } } string += "\n"; } System.out.println(string); } }