Instantly share code, notes, and snippets.
CreatedJuly 18, 2025 17:29
Save Joskipank/69b7de83a5a287c3e6af4685b2c5eec0 to your computer and use it in GitHub Desktop.
Java циклы
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 characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
for(int i = 1; i <= 2025; i++) { | |
if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) { | |
System.out.println("год весокосный " + i); | |
} else { | |
System.out.println("год не весокосный " + i); | |
} | |
} | |
int health = 11; | |
while(health > 0) { | |
health--; | |
if(health == 6){ | |
continue; | |
} else if(health == 2){ | |
break; | |
} | |
System.out.println(health + "HP"); | |
} | |
} | |
} |
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment