Skip to content

Instantly share code, notes, and snippets.

@ilyaBrandon
Created February 23, 2016 18:58
Show Gist options
  • Save ilyaBrandon/5e1488a51e40a0fdeaec to your computer and use it in GitHub Desktop.
Save ilyaBrandon/5e1488a51e40a0fdeaec to your computer and use it in GitHub Desktop.
public class BATTLEFRONT {
public static void main(String[] args) {
System.out.println(isSpring(12));
System.out.println(isSpring(-10));
System.out.println(isSpring(47));
System.out.println(isSpring(10));
System.out.println(isSpring(100));
}
static int isSpring(int month) {
if (month >= 3 && month <= 5) {
return 1;
}
if (month >= 1 && month <= 12) {
return 0;
}
return 1;
}
}
@liuiv15
Copy link

liuiv15 commented Feb 25, 2016

А когда возвращается -1 как задано по условию?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment