[JAVA] AtCoder [ABC086A] Technical memo

Introduction

I will make a note of the second, AtCoder

AtCoder problem

Deer AtCoDeer found two positive integers a and b. Determine if the product of a and b is even or odd.

Commentary

You can also calculate based on the entered numbers. Is it the turn of nextInt ()?

Prepare for input

Scanner scanner = new Scanner(System.in);

int a = scanner.nextInt();
int b = scanner.nextInt();

if((a * b) % 2 == 1) {

 System.out.println("Odd");

} else {

 System.out.println("Even");

}

The problem this time was an instant kill because I was able to use the Scanner and nextInt () I used last time.

See you next time.

Recommended Posts

AtCoder [ABC086A] Technical memo
AtCoder [Practice A] Technical memo
[Technical memo] How to resolve errors
[Technical memo] What is "include" in Ruby?