Skip to content

Create Joonas_Kokamägi_Kodutöö_1_done - #78

Open
jhkoka wants to merge 1 commit into
pralg17:masterfrom
jhkoka:patch-1
Open

Create Joonas_Kokamägi_Kodutöö_1_done#78
jhkoka wants to merge 1 commit into
pralg17:masterfrom
jhkoka:patch-1

Conversation

@jhkoka

@jhkoka jhkoka commented Feb 10, 2017

Copy link
Copy Markdown

No description provided.

@jhkoka

jhkoka commented Feb 10, 2017

Copy link
Copy Markdown
Author

public class Liigaasta {
public static boolean Liigaasta(int year)
{
if( year % 4 != 0 ){
return false;
}

if(( year % 400 != 0 ) && (year % 100 == 0)){
return false;
}else{
return true;
}
}

public static void main (String[] args){
int year = 0;
String input = "";
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
while(true){
System.out.println("Sisesta aasta: ");
try {
input = in.readLine();
year = Integer.valueOf( input ).intValue();
} catch (IOException e) {
e.printStackTrace();
}
if(year < 0){break;}
System.out.print ("Liigaasta ");
System.out.println( Liigaasta(year) );
}
}
}

@jhkoka jhkoka changed the title Create Joonas_Kokamägi_Kodutöö_1 Create Joonas_Kokamägi_Kodutöö_1_done Feb 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant