paizaラーニングレベルアップ問題集の【条件分岐メニュー】をやってみた。(3)

paizaラーニングレベルアップ問題集の【条件分岐メニュー】をやってみました。
- - -
##### 問題
###### 3の倍数判定
https://paiza.jp/works/mondai/conditions_branch/conditions_branch__mod_step1
###### 2つの倍数判定
https://paiza.jp/works/mondai/conditions_branch/conditions_branch__mod_step2
###### 偶奇の判定
https://paiza.jp/works/mondai/conditions_branch/conditions_branch__mod_step3
###### 曜日の判定
https://paiza.jp/works/mondai/conditions_branch/conditions_branch__mod_step4
###### FizzBuzz
https://paiza.jp/works/mondai/conditions_branch/conditions_branch__mod_boss
- - -
`else-if`文を扱う前に`switch`文を扱っております。（出題者の意図としては`else-if`を使うことを想定していたかもしれませんが）
- - -
##### C
###### 3の倍数判定
```c
#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	if (n % 3 == 0) {
		puts("YES");
	} else {
		puts("NO");
	}
	return 0;
}
```
```c
#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	puts(n % 3 ? "NO" : "YES");
	return 0;
}
```
###### 2つの倍数判定
```c
#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	if (n % 3 == 0 && n % 5 == 0) {
		puts("YES");
	} else {
		puts("NO");
	}
	return 0;
}
```
```c
#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	puts(n % 3 || n % 5 ? "NO" : "YES");
	return 0;
}
```
###### 偶奇の判定
```c
#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	int even = 0;
	int odd = 0;
	for (int i = 0; i < n; i++) {
		int a;
		scanf("%d", &a);
		if (a % 2 == 0) {
			even++;
		} else {
			odd++;
		}
	}
	printf("%d %d\n", even, odd);
	return 0;
}
```
```c
#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	int count[2] = {};
	for (int i = 0; i < n; i++) {
		int a;
		scanf("%d", &a);
		count[a%2]++;
	}
	printf("%d %d\n", count[0], count[1]);
	return 0;
}
```
###### 曜日の判定
```c
#include <stdio.h>

int main() {
	int x;
	scanf("%d", &x);
	switch (x % 7) {
		case 1:
			puts("Sun");
			break;
		case 2:
			puts("Mon");
			break;
		case 3:
			puts("Tue");
			break;
		case 4:
			puts("Wed");
			break;
		case 5:
			puts("Thu");
			break;
		case 6:
			puts("Fri");
			break;
		default:
			puts("Sat");
	}
	return 0;
}
```
```c
#include <stdio.h>

const char* WDAY[] = {"Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri"};

int main() {
	int x;
	scanf("%d", &x);
	puts(WDAY[x%7]);
	return 0;
}
```
###### FizzBuzz
```c
#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	if (n % 3 == 0) {
		if (n % 5 == 0) {
			puts("FizzBuzz");
		} else {
			puts("Fizz");
		}
	} else {
		if (n % 5 == 0) {
			puts("Buzz");
		} else {
			printf("%d\n", n);
		}
	}
	return 0;
}
```
```c
#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	return (n%3?n%5?printf("%d\n", n):puts("Buzz"):puts(n%5?"Fizz":"FizzBuzz")) * 0;
}
```
- - -
##### C++
###### 3の倍数判定
```cpp
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	if (n % 3 == 0) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	return 0;
}
```
```cpp
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	cout << (n % 3 ? "NO" : "YES") << endl;
	return 0;
}
```
###### 2つの倍数判定
```cpp
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	if (n % 3 == 0 && n % 5 == 0) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	return 0;
}
```
```cpp
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	cout << (n % 3 || n % 5 ? "NO" : "YES") << endl;
	return 0;
}
```
###### 偶奇の判定
```cpp
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	int even = 0;
	int odd = 0;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		if (a % 2 == 0) {
			even++;
		} else {
			odd++;
		}
	}
	cout << even << ' ' << odd << endl;
	return 0;
}
```
```cpp
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	int count[2] = {};
	while (n--) {
		int a;
		cin >> a;
		count[a % 2]++;
	}
	cout << count[0] << ' ' << count[1] << endl;
	return 0;
}
```
###### 曜日の判定
```cpp
#include <iostream>
using namespace std;

int main() {
	int x;
	cin >> x;
	switch (x % 7) {
		case 1:
			cout << "Sun" << endl;
			break;
		case 2:
			cout << "Mon" << endl;
			break;
		case 3:
			cout << "Tue" << endl;
			break;
		case 4:
			cout << "Wed" << endl;
			break;
		case 5:
			cout << "Thu" << endl;
			break;
		case 6:
			cout << "Fri" << endl;
			break;
		default:
			cout << "Sat" << endl;
	}
	return 0;
}
```
```cpp
#include <iostream>
using namespace std;

const string WDAY[] = { "Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri" };

int main() {
	int x;
	cin >> x;
	cout << WDAY[x%7] << endl;
}
```
###### FizzBuzz
```cpp
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	if (n % 3 == 0) {
		if (n % 5 == 0) {
			cout << "FizzBuzz" << endl;
		} else {
			cout << "Fizz" << endl;
		}
	} else {
		if (n % 5 == 0) {
			cout << "Buzz" << endl;
		} else {
			cout << n << endl;
		}
	}
	return 0;
}
```
```cpp
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	cout << (n%3?n%5?to_string(n):"Buzz":n%5?"Fizz":"FizzBuzz") << endl;
	return 0;
}
```
- - -
##### C#
###### 3の倍数判定
```cs
using System;

class Program
{
	public static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		if (n % 3 == 0) {
			Console.WriteLine("YES");
		} else {
			Console.WriteLine("NO");
		}
	}
}
```
```cs
using System;

class Program
{
	public static void Main()
	{
		Console.WriteLine(int.Parse(Console.ReadLine()) % 3 == 0 ? "YES" : "NO");
	}
}
```
###### 2つの倍数判定
```cs
using System;

class Program
{
	public static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		if (n % 3 == 0 && n % 5 == 0) {
			Console.WriteLine("YES");
		} else {
			Console.WriteLine("NO");
		}
	}
}
```
```cs
using System;

class Program
{
	public static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		Console.WriteLine(n % 3 == 0 && n % 5 == 0 ? "YES" : "NO");
	}
}
```
###### 偶奇の判定
```cs
using System;

class Program
{
	public static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		int[] A = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		int even = 0;
		int odd = 0;
		for (int i = 0; i < n; i++) {
			if (A[i] % 2 == 0) {
				even++;
			} else {
				odd++;
			}
		}
		Console.WriteLine("" + even + ' ' + odd);
	}
}
```
```cs
using System;

class Program
{
	public static void Main()
	{
		int[] count = new int[2];
		int n = int.Parse(Console.ReadLine());
		foreach (int a in Array.ConvertAll(Console.ReadLine().Split(), int.Parse)) count[a%2]++;
		Console.WriteLine("" + count[0] + ' ' + count[1]);
	}
}
```
###### 曜日の判定
```cs
using System;

class Program
{
	public static void Main()
	{
		int x = int.Parse(Console.ReadLine());
		switch (x % 7) {
			case 1:
				Console.WriteLine("Sun");
				break;
			case 2:
				Console.WriteLine("Mon");
				break;
			case 3:
				Console.WriteLine("Tue");
				break;
			case 4:
				Console.WriteLine("Wed");
				break;
			case 5:
				Console.WriteLine("Thu");
				break;
			case 6:
				Console.WriteLine("Fri");
				break;
			default:
				Console.WriteLine("Sat");
				break;
		}
	}
}
```
```cs
using System;

class Program
{

	static readonly string[] WDAY = { "Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri" };
	
	public static void Main()
	{
		Console.WriteLine(WDAY[int.Parse(Console.ReadLine()) % 7]);
	}
}
```
###### FizzBuzz
```cs
using System;

class Program
{
	public static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		if (n % 3 == 0) {
			if (n % 5 == 0) {
				Console.WriteLine("FizzBuzz");
			} else {
				Console.WriteLine("Fizz");
			}
		} else {
			if (n % 5 == 0) {
				Console.WriteLine("Buzz");
			} else {
				Console.WriteLine(n);
			}
		}
	}
}
```
```cs
using System;

class Program
{
	public static void Main()
	{
		int n = int.Parse(Console.ReadLine());
		Console.WriteLine(n%3==0?n%5==0?"FizzBuzz":"Fizz":n%5==0?"Buzz":n.ToString());
	}
}
```
- - -
##### Go
###### 3の倍数判定
```go
package main
import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	if n % 3 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
```
###### 2つの倍数判定
```go
package main
import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	if n % 3 == 0 && n % 5 == 0 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
```
###### 偶奇の判定
```go
package main
import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	even := 0
	odd := 0
	for i := 0; i < n; i++ {
		var a int
		fmt.Scan(&a)
		if a % 2 == 0 {
			even++
		} else {
			odd++
		}
	}
	fmt.Println(even, odd)
}
```
```go
package main
import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	count := [2]int{}
	for i := 0; i < n; i++ {
		var a int
		fmt.Scan(&a)
		count[a%2]++
	}
	fmt.Println(count[0], count[1])
}
```
###### 曜日の判定
```go
package main
import "fmt"

func main() {
	var x int
	fmt.Scan(&x)
	switch x % 7 {
		case 1:
			fmt.Println("Sun")
		case 2:
			fmt.Println("Mon")
		case 3:
			fmt.Println("Tue")
		case 4:
			fmt.Println("Wed")
		case 5:
			fmt.Println("Thu")
		case 6:
			fmt.Println("Fri")
		default:
			fmt.Println("Sat")
	}
}
```
```go
package main
import "fmt"

var WDAY = []string{ "Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri" }

func main() {
	var x int
	fmt.Scan(&x)
	fmt.Println(WDAY[x%7])
}
```
###### FizzBuzz
```go
package main
import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	if n % 3 == 0 {
		if n % 5 == 0 {
			fmt.Println("FizzBuzz")
		} else {
			fmt.Println("Fizz")
		}
	} else {
		if n % 5 == 0 {
			fmt.Println("Buzz")
		} else {
			fmt.Println(n)
		}
	}
}
```
- - -
##### Java
###### 3の倍数判定
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		if (n % 3 == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}
```
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println(sc.nextInt() % 3 == 0 ? "YES" : "NO");
		sc.close();
	}
}
```
###### 2つの倍数判定
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		if (n % 3 == 0 && n % 5 == 0) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}
```
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		System.out.println(n % 3 == 0 && n % 5 == 0 ? "YES" : "NO");
	}
}
```
###### 偶奇の判定
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int even = 0;
		int odd = 0;
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			if (a % 2 == 0) {
				even++;
			} else {
				odd++;
			}
		}
		sc.close();
		System.out.println("" + even + ' ' + odd);
	}
}
```
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		int[] count = new int[2];
		for (int a : Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray()) {
			count[a%2]++;
		}
		sc.close();
		System.out.println("" + count[0] + ' ' + count[1]);
	}
}
```
###### 曜日の判定
```java
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		sc.close();
		switch (x % 7) {
			case 1:
				System.out.println("Sun");
				break;
			case 2:
				System.out.println("Mon");
				break;
			case 3:
				System.out.println("Tue");
				break;
			case 4:
				System.out.println("Wed");
				break;
			case 5:
				System.out.println("Thu");
				break;
			case 6:
				System.out.println("Fri");
				break;
			default:
				System.out.println("Sat");
				break;
		}
	}
}
```
```java
import java.util.*;

public class Main {

	static final String[] WDAY = { "Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri" };

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println(WDAY[sc.nextInt()%7]);
		sc.close();
	}
}
```
###### FizzBuzz
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		if (n % 3 == 0) {
			if (n % 5 == 0) {
				System.out.println("FizzBuzz");
			} else {
				System.out.println("Fizz");
			}
		} else {
			if (n % 5 == 0) {
				System.out.println("Buzz");
			} else {
				System.out.println(n);
			}
		}
	}
}
```
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		System.out.println(n%3==0?n%5==0?"FizzBuzz":"Fizz":n%5==0?"Buzz":String.valueOf(n));
	}
}
```
- - -
##### JavaScript
###### 3の倍数判定
```js
const n = Number(require("fs").readFileSync("/dev/stdin", "utf8"));
if (n % 3 === 0) {
	console.log("YES");
} else {
	console.log("NO");
}
```
```js
console.log(Number(require("fs").readFileSync("/dev/stdin", "utf8")) % 3 ? "NO" : "YES");
```
###### 2つの倍数判定
```js
const n = Number(require("fs").readFileSync("/dev/stdin", "utf8"));
if (n % 3 === 0 && n % 5 === 0) {
	console.log("YES");
} else {
	console.log("NO");
}
```
```js
const n = Number(require("fs").readFileSync("/dev/stdin", "utf8"));
console.log(n % 3 || n % 5 ? "NO" : "YES");
```
###### 偶奇の判定
```js
const lines = require("fs").readFileSync("/dev/stdin", "utf8").trim().split('\n');
const n = Number(lines[0]);
const A = lines[1].split(' ').map(Number);
let even = 0;
let odd = 0;
for (var i = 0; i < n; i++) {
	if (A[i] % 2 == 0) {
		even++;
	} else {
		odd++;
	}
}
console.log(even, odd);
```
```js
const [N, A] = require("fs").readFileSync("/dev/stdin", "utf8").trim().split('\n').map(s => s.split(' ').map(Number));
console.log(...Array(2).fill().map((_, j) => A.filter(a => a % 2 === j).length));
```
###### 曜日の判定
```js
const x = Number(require("fs").readFileSync("/dev/stdin", "utf8"));
switch (x % 7) {
	case 1:
		console.log("Sun");
		break;
	case 2:
		console.log("Mon");
		break;
	case 3:
		console.log("Tue");
		break;
	case 4:
		console.log("Wed");
		break;
	case 5:
		console.log("Thu");
		break;
	case 6:
		console.log("Fri");
		break;
	default:
		console.log("Sat");
}
```
```js
const WDAY = ["Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
console.log(WDAY[Number(require("fs").readFileSync("/dev/stdin", "utf8"))%7]);
```
###### FizzBuzz
```js
const n = Number(require("fs").readFileSync("/dev/stdin", "utf8"));
if (n % 3 === 0) {
	if (n % 5 === 0) {
		console.log("FizzBuzz");
	} else {
		console.log("Fizz");
	}
} else {
	if (n % 5 === 0) {
		console.log("Buzz");
	} else {
		console.log(n);
	}
}
```
```js
const n = Number(require("fs").readFileSync("/dev/stdin", "utf8"));
console.log((n%3?"":"Fizz")+(n%5?"":"Buzz")||String(n));
```
- - -
##### Kotlin
###### 3の倍数判定
```kotlin
fun main() {
	val n = readLine()!!.toInt()
	if (n % 3 == 0) {
		println("YES")
	} else {
		println("NO")
	}
}
```
```kotlin
fun main() {
	println(if (readLine()!!.toInt() % 3 == 0) "YES" else "NO")
}
```
###### 2つの倍数判定
```kotlin
fun main() {
	val n = readLine()!!.toInt()
	if (n % 3 == 0 && n % 5 == 0) {
		println("YES")
	} else {
		println("NO")
	}
}
```
```kotlin
fun main() {
	val n = readLine()!!.toInt()
	println(if (n % 3 == 0 && n % 5 == 0) "YES" else "NO")
}
```
###### 偶奇の判定
```kotlin
fun main() {
	val n = readLine()!!.toInt()
	val A = readLine()!!.split(' ').map { it.toInt() }
	var even = 0
	var odd = 0
	for (i in 0 until n) {
		if (A[i] % 2 == 0) {
			even++
		} else {
			odd++
		}
	}
	println("" + even + ' ' + odd)
}
```
```kotlin
fun main() {
	/* val n = */readLine()//!!.toInt()
	val count = Array(2){ 0 }
	for (a in readLine()!!.split(' ').map { it.toInt() }) {
		count[a%2]++
	}
	println("" + count[0] + ' ' + count[1])
}
```
###### 曜日の判定
```kotlin
fun main() {
	val x = readLine()!!.toInt()
	println(when(x % 7) {
		1 -> "Sun"
		2 -> "Mon"
		3 -> "Tue"
		4 -> "Wed"
		5 -> "Thu"
		6 -> "Fri"
		else -> "Sat"
	})
}
```
```kotlin
val WDAY = arrayOf("Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri")

fun main() {
	println(WDAY[readLine()!!.toInt()%7])
}
```
###### FizzBuzz
```kotlin
fun main() {
	val n = readLine()!!.toInt()
	if (n % 3 == 0) {
		if (n % 5 == 0) {
			println("FizzBuzz")
		} else {
			println("Fizz")
		}
	} else {
		if (n % 5 == 0) {
			println("Buzz")
		} else {
			println(n)
		}
	}
	println()
}
```
```kotlin
fun main() {
	val n = readLine()!!.toInt()
	println(if (n % 3 == 0) if (n % 5 == 0) "FizzBuzz" else "Fizz" else if (n % 5 == 0) "Buzz" else n.toString())
}
```
- - -
##### PHP
###### 3の倍数判定
```php
<?php
	$n = intval(fgets(STDIN));
	if ($n % 3 === 0) {
		echo "YES", PHP_EOL;
	} else {
		echo "NO", PHP_EOL;
	}
?>
```
```php
<?php
	echo intval(fgets(STDIN)) % 3 ? "NO" : "YES", PHP_EOL;
?>
```
###### 2つの倍数判定
```php
<?php
	$n = intval(fgets(STDIN));
	if ($n % 3 === 0 && $n % 5 === 0) {
		echo "YES", PHP_EOL;
	} else {
		echo "NO", PHP_EOL;
	}
?>
```
```php
<?php
	$n = intval(fgets(STDIN));
	echo $n % 3 || $n % 5 ? "NO" : "YES", PHP_EOL;
?>
```
###### 偶奇の判定
```php
<?php
	$n = intval(fgets(STDIN));
	$A = array_map("intval", explode(' ', fgets(STDIN)));
	$even = 0;
	$odd = 0;
	for ($i = 0; $i < $n; $i++) {
		if ($A[$i] % 2 == 0) {
			$even++;
		} else {
			$odd++;
		}
	}
	echo $even, ' ', $odd, PHP_EOL;
?>
```
```php
<?php
	$n = intval(fgets(STDIN));
	$A = array_map("intval", explode(' ', fgets(STDIN)));
	$even = array_filter($A, function($a) { return $a % 2 === 0; });
	$odd = array_filter($A, function($a) { return $a % 2 === 1; });
	echo count($even), ' ', count($odd), PHP_EOL;
?>
```
###### 曜日の判定
```php
<?php
	$x = intval(fgets(STDIN));
	switch ($x % 7) {
		case 1:
			echo "Sun", PHP_EOL;
			break;
		case 2:
			echo "Mon", PHP_EOL;
			break;
		case 3:
			echo "Tue", PHP_EOL;
			break;
		case 4:
			echo "Wed", PHP_EOL;
			break;
		case 5:
			echo "Thu", PHP_EOL;
			break;
		case 6:
			echo "Fri", PHP_EOL;
			break;
		default:
			echo "Sat", PHP_EOL;
	}
?>
```
```php
<?php
	echo ["Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri"][intval(fgets(STDIN)) % 7]
?>

```
###### FizzBuzz
```php
<?php
	$n = intval(fgets(STDIN));
	if ($n % 3 === 0) {
		if ($n % 5 === 0) {
			echo "FizzBuzz", PHP_EOL;
		} else {
			echo "Fizz", PHP_EOL;
		}
	} else {
		if ($n % 5 === 0) {
			echo "Buzz", PHP_EOL;
		} else {
			echo $n, PHP_EOL;
		}
	}
?>
```
```php
<?php
	$n = intval(fgets(STDIN));
	echo $n%3?($n%5?strval($n):"Buzz"):("Fizz".($n%5?"":"Buzz")), PHP_EOL;
?>
```
- - -
##### Perl
###### 3の倍数判定
```pl
my $n = int(<STDIN>);
if ($n % 3 == 0) {
	print "YES$/";
} else {
	print "NO$/";
}
```
```pl
print int(<STDIN>) % 3 ? "NO" : "YES", $/;
```
###### 2つの倍数判定
```pl
my $n = int(<STDIN>);
if ($n % 3 == 0 && $n % 5 == 0) {
	print "YES$/";
} else {
	print "NO$/";
}
```
```pl
my $n = int(<STDIN>);
print $n % 3 || $n % 5 ? "NO" : "YES", $/;
```
###### 偶奇の判定
```pl
my $n = int(<STDIN>);
my $even = 0;
my $odd = 0;
my @A = map { int($_) } split ' ', <STDIN>;
for (my $i = 0; $i < $n; $i++) {
	if ($A[$i] % 2 == 0) {
		$even++;
	} else {
		$odd++;
	}
}
print "$even $odd$/";
```
```pl
my $n = int(<STDIN>);
my @A = map { int($_) } split ' ', <STDIN>;
my @count = (0) x 2;
for (my $i = 0; $i < $n; $i++) {
	$count[$A[$i] % 2]++;
}
print $count[0], ' ', $count[1], $/;
```
###### 曜日の判定
```pl
use 5.010001;

my $x = int(<STDIN>);
given ($x % 7) {
	when (1) { print "Sun$/"; }
	when (2) { print "Mon$/"; }
	when (3) { print "Tue$/"; }
	when (4) { print "Wed$/"; }
	when (5) { print "Thu$/"; }
	when (6) { print "Fri$/"; }
	default { print "Sat$/"; }
}
```
```pl
@WDAY = ("Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri");
print $WDAY[int(<STDIN>) % 7], $/;
```
###### FizzBuzz
```pl
$n = int(<STDIN>);
if ($n % 3 == 0) {
	if ($n % 5 == 0) {
		print "FizzBuzz$/";
	} else {
		print "Fizz$/";
	}
} else {
	if ($n % 5 == 0) {
		print "Buzz$/";
	} else {
		print "$n$/";
	}
}
```
```pl
my $n = int(<STDIN>);
print ((($n%3?"":"Fizz").($n%5?"":"Buzz"))||$n, $/);
```
- - -
##### Python3
###### 3の倍数判定
```py
n = int(input())
if n % 3 == 0:
	print("YES")
else:
	print("NO")
```
```py
print("NO" if int(input()) % 3 else "YES")
```
###### 2つの倍数判定
```py
n = int(input())
if n % 3 == 0 and n % 5 == 0:
	print("YES")
else:
	print("NO")
```
```py
n = int(input())
print("NO" if n % 3 or n % 5 else "YES")
```
###### 偶奇の判定
```py
n = int(input())
A = list(map(int, input().split()))
even = odd = 0
for i in range(n):
	if A[i] % 2 == 0:
		even += 1
	else:
		odd += 1
print(even, odd)
```
```py
n = int(input())
A = list(map(int, input().split()))
print(*[sum(a % 2 == i for a in A) for i in range(2)])
```
```py
import numpy as np
n = int(input())
A = np.array(list(map(int, input().split())))
print(*[(A%2==i).sum() for i in range(2)])
```
###### 曜日の判定
```py
x = int(input())
x %= 7
if x == 1:
	print("Sun")
elif x == 2:
	print("Mon")
elif x == 3:
	print("Tue")
elif x == 4:
	print("Wed")
elif x == 5:
	print("Thu")
elif x == 6:
	print("Fri")
else:
	print("Sat")
```
```py
print(["Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri"][int(input()) % 7])
```
###### FizzBuzz
```py
n = int(input())
if n % 3 == 0:
	if n % 5 == 0:
		print("FizzBuzz")
	else:
		print("Fizz")
else:
	if n % 5 == 0:
		print("Buzz")
	else:
		print(n)
```
```py
n = int(input())
print(("" if n%3 else "Fizz")+("" if n%5 else "Buzz") or n)
```
- - -
##### Ruby
###### 3の倍数判定
```rb
n = gets.to_i
if n % 3 == 0
	puts "YES"
else
	puts "NO"
end
```
```rb
puts gets.to_i % 3 == 0 ? "YES" : "NO"
```
###### 2つの倍数判定
```rb
n = gets.to_i
if n % 3 == 0 && n % 5 == 0
	puts "YES"
else
	puts "NO"
end
```
```rb
n = gets.to_i
puts n % 3 == 0 && n % 5 == 0 ? "YES" : "NO"
```
###### 偶奇の判定
```rb
n = gets.to_i
A = gets.split.map(&:to_i)
even = 0
odd = 0
n.times do |i|
	if A[i] % 2 == 0
		even += 1
	else
		odd += 1
	end
end
print even, ' ', odd, "\n"
```
```rb
n = gets.to_i
A = gets.split.map(&:to_i)
puts 2.times.map{|i| A.filter{|a| a % 2 == i}.count}.join(' ')
```
###### 曜日の判定
```rb
x = gets.to_i
case x % 7
when 1
	puts "Sun"
when 2
	puts "Mon"
when 3
	puts "Tue"
when 4
	puts "Wed"
when 5
	puts "Thu"
when 6
	puts "Fri"
else
	puts "Sat"
end
```
```rb
WDAY = ["Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri"]
puts WDAY[gets.to_i % 7]
```
###### FizzBuzz
```rb
n = gets.to_i
if n % 3 == 0
	if n % 5 == 0
		puts "FizzBuzz"
	else
		puts "Fizz"
	end
else
	if n % 5 == 0
		puts "Buzz"
	else
		p n
	end
end
```
```rb
n = gets.to_i
puts n%3==0?n%5==0?"FizzBuzz":"Fizz":n%5==0?"Buzz":n.to_s
```
- - -
##### Scala
###### 3の倍数判定
```scala
import scala.io.StdIn._

object Main extends App{
	val n = readInt()
	if (n % 3 == 0) {
		println("YES")
	} else {
		println("NO")
	}
}
```
```scala
import scala.io.StdIn._

object Main extends App{
	println(if (readInt() % 3 == 0) "YES" else "NO")
}
```
###### 2つの倍数判定
```scala
import scala.io.StdIn._

object Main extends App{
	val n = readInt()
	if (n % 3 == 0 && n % 5 == 0) {
		println("YES")
	} else {
		println("NO")
	}
}
```
```scala
import scala.io.StdIn._

object Main extends App{
	val n = readInt()
	println(if (n % 3 == 0 && n % 5 == 0) "YES" else "NO")
}
```
###### 偶奇の判定
```scala
import scala.io.StdIn._

object Main extends App{
	val n = readInt()
	val A = readLine().split(' ').map { _.toInt }
	var even = 0
	var odd = 0
	for (i <- 0 until n) {
		if (A(i) % 2 == 0) {
			even += 1
		} else {
			odd += 1
		}
	}
	println("" + even + ' ' + odd)
}
```
```scala
import scala.io.StdIn._

object Main extends App{
	val n = readInt()
	val A = readLine().split(' ').map{_.toInt}
	val even = A.filter(_ % 2 == 0)
	val odd = A.filter(_ % 2 == 1)
	println("" + even.length + ' ' + odd.length)
}
```
###### 曜日の判定
```scala
import scala.io.StdIn._

object Main extends App{
	val x = readInt()
	println(x % 7 match {
		case 1 => "Sun"
		case 2 => "Mon"
		case 3 => "Tue"
		case 4 => "Wed"
		case 5 => "Thu"
		case 6 => "Fri"
		case _ => "Sat"
	})
}
```
```scala
import scala.io.StdIn._

object Main extends App{
	val WDAY = Array("Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri")
	println(WDAY(readInt() % 7))
}
```
###### FizzBuzz
```scala
import scala.io.StdIn._

object Main extends App{
	val n = readInt()
	if (n % 3 == 0) {
		if (n % 5 == 0) {
			println("FizzBuzz")
		} else {
			println("Fizz")
		}
	} else {
		if (n % 5 == 0) {
			println("Buzz")
		} else {
			println(n)
		}
	}
}
```
```scala
import scala.io.StdIn._

object Main extends App{
	val n = readInt()
	println(if (n % 3 == 0) if (n % 5 == 0) "FizzBuzz" else "Fizz" else if (n % 5 == 0) "Buzz" else n.toString)
}
```
- - -
##### Swift
###### 3の倍数判定
```swift
let n = Int(readLine()!)!
if n % 3 == 0 {
	print("YES")
} else {
	print("NO")
}
```
```swift
print(Int(readLine()!)! % 3 == 0 ? "YES" : "NO")
```
###### 2つの倍数判定
```swift
let n = Int(readLine()!)!
if n % 3 == 0 && n % 5 == 0 {
	print("YES")
} else {
	print("NO")
}
```
```swift
let n = Int(readLine()!)!
print(n % 3 == 0 && n % 5 == 0 ? "YES" : "NO")
```
###### 偶奇の判定
```swift
let n = Int(readLine()!)!
let A = readLine()!.split(separator: " ").compactMap { Int($0) }
var even = 0
var odd = 0
for i in 0..<n {
	if A[i] % 2 == 0 {
		even += 1
	} else {
		odd += 1
	}
}
print(even, odd)
```
```swift
let n = Int(readLine()!)!
let A = readLine()!.split(separator: " ").compactMap { Int($0) }
let even = A.filter { $0 % 2 == 0 }
let odd = A.filter { $0 % 2 == 1 }
print(even.count, odd.count)
```
###### 曜日の判定
```swift
let x = Int(readLine()!)!
switch x % 7 {
	case 1:
		print("Sun")
	case 2:
		print("Mon")
	case 3:
		print("Tue")
	case 4:
		print("Wed")
	case 5:
		print("Thu")
	case 6:
		print("Fri")
	default:
		print("Sat")
}
```
```swift
let WDAY = ["Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri"]
print(WDAY[Int(readLine()!)!%7])
```
###### FizzBuzz
```swift
let n = Int(readLine()!)!
if n % 3 == 0 {
	if n % 5 == 0 {
		print("FizzBuzz")
	} else {
		print("Fizz")
	}
} else {
	if n % 5 == 0 {
		print("Buzz")
	} else {
		print(n)
	}
}
```