Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Tasks2;
- public class Cycle1 {
- public static void main(String[] args) {
- for (int i = 1; i <= 100; i++) {
- String str = "";
- int a = str.indexOf(str);
- if ((i % 5 == 0)) {
- str += "Buzz";
- }
- if (i % 3 == 0) {
- str += "Fizz";
- }
- if (str == str) {
- str += a;
- System.out.println(str);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement