paizaラーニングレベルアップ問題集の【代入演算】をやってみた。

paizaラーニングレベルアップ問題集の【代入演算】をやってみました。
- - -
##### 問題
###### 代入演算1
https://paiza.jp/works/mondai/arithmetic_substitution_op/arithmetic_substitution_op__substitution_step1
###### 代入演算2
https://paiza.jp/works/mondai/arithmetic_substitution_op/arithmetic_substitution_op__substitution_step2
###### 代入演算3
https://paiza.jp/works/mondai/arithmetic_substitution_op/arithmetic_substitution_op__substitution_step3
###### 代入演算4
https://paiza.jp/works/mondai/arithmetic_substitution_op/arithmetic_substitution_op__substitution_step4
- - -
##### C
###### 代入演算1
```c
#include <stdio.h>

int main() {
	int n = 0;
	n += 3286;
	n *= 4736;
	n %= 12312;
	printf("%d\n", n);
	return 0;
}
```
###### 代入演算2
```c
#include <stdio.h>

int main() {
	int a, b, c;
	scanf("%d %d %d", &a, &b, &c);
	int n = 0;
	n += a;
	n *= b;
	n %= c;
	printf("%s\n", n);
	return 0;
}
```
###### 代入演算3
```c
#include <stdio.h>

int main() {
	int n = 10000;
	n /= 361;
	n %= 28;
	printf("%d\n", n);
	return 0;
}
```
###### 代入演算4
```c
#include <stdio.h>

int main() {
	int a, b;
	scanf("%d %d", &a, &b);
	int n = 10000;
	n /= a;
	n %= b;
	printf("%d\n", n);
	return 0;
}
```
- - -
##### C++
###### 代入演算1
```cpp
#include <iostream>
using namespace std;

int main() {
	int n = 0;
	n += 3286;
	n *= 4736;
	n %= 12312;
	cout << n << endl;
	return 0;
}
```
###### 代入演算2
```cpp
#include <iostream>
using namespace std;

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	int n = 0;
	n += a;
	n *= b;
	n %= c;
	cout << n << endl;
	return 0;
}
```
###### 代入演算3
```cpp
#include <iostream>
using namespace std;

int main() {
	int n = 10000;
	n /= 361;
	n %= 28;
	cout << n << endl;
	return 0;
}
```
###### 代入演算4
```cpp
#include <iostream>
using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	int n = 10000;
	n /= a;
	n %= b;
	cout << n << endl;
	return 0;
}
```
- - -
##### C#
###### 代入演算1
```cs
using System;

class Program
{
	public static void Main()
	{
		int n = 0;
		n += 3286;
		n *= 4736;
		n %= 12312;
		Console.WriteLine(n);
	}
}
```
###### 代入演算2
```cs
using System;

class Program
{
	public static void Main()
	{
		int[] abc = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		int n = 0;
		n += abc[0];
		n *= abc[1];
		n %= abc[2];
		Console.WriteLine(n);
	}
}
```
###### 代入演算3
```cs
using System;

class Program
{
	public static void Main()
	{
		int n = 10000;
		n /= 361;
		n %= 28;
		Console.WriteLine(n);
	}
}
```
###### 代入演算4
```cs
using System;

class Program
{
	public static void Main()
	{
		int[] ab = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
		int n = 10000;
		n /= ab[0];
		n %= ab[1];
		Console.WriteLine(n);
	}
}
```
- - -
##### Go
###### 代入演算1
```go
package main
import "fmt"

func main() {
	n := 0
	n += 3286
	n *= 4736
	n %= 12312
	fmt.Println(n)
}
```
###### 代入演算2
```go
package main
import "fmt"

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c);
	n := 0;
	n += a;
	n *= b;
	n %= c;
	fmt.Println(n)
}
```
###### 代入演算3
```go
package main
import "fmt"

func main() {
	n := 10000
	n /= 361
	n %= 28
	fmt.Println(n)
}
```
###### 代入演算4
```go
package main
import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b);
	n := 10000
	n /= a
	n %= b
	fmt.Println(n)
}
```
- - -
##### Java
###### 代入演算1
```java
public class Main {
	public static void main(String[] args) {
		int n = 0;
		n += 3286;
		n *= 4736;
		n %= 12312;
		System.out.println(n);
	}
}
```
###### 代入演算2
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = 0;
		n += sc.nextInt();
		n *= sc.nextInt();
		n %= sc.nextInt();
		sc.close();
		System.out.println(n);
	}
}
```
###### 代入演算3
```java
public class Main {
	public static void main(String[] args) {
		int n = 10000;
		n /= 361;
		n %= 28;
		System.out.println(n);
	}
}
```
###### 代入演算4
```java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = 10000;
		n /= sc.nextInt();
		n %= sc.nextInt();
		System.out.println(n);
		sc.close();
	}
}
```
- - -
##### JavaScript
###### 代入演算1
```js
let n = 0;
n += 3286;
n *= 4736;
n %= 12312;
console.log(n);
```
###### 代入演算2
```js
const [a, b, c] = require("fs").readFileSync("/dev/stdin", "utf8").split(' ').map(Number);
let n = 0;
n += a;
n *= b;
n %= c;
console.log(n);
```
###### 代入演算3
```js
let n = 10000;
n /= 361;
n = parseInt(n);
n %= 28;
console.log(n);
```
###### 代入演算4
```js
const [a, b] = require("fs").readFileSync("/dev/stdin", "utf8").split(' ').map(Number);
let n = 10000;
n /= a;
n = parseInt(n);
n %= b;
console.log(n);
```
- - -
##### Kotlin
###### 代入演算1
```kotlin
fun main() {
	var n = 0
	n += 3286
	n *= 4736
	n %= 12312
	println(n)
}
```
###### 代入演算2
```kotlin
fun main() {
	val (a, b, c) = readLine()!!.split(' ').map { it.toInt() }
	var n = 0
	n += a
	n *= b
	n %= c
	println(n)
}
```
###### 代入演算3
```kotlin
fun main() {
	var n = 10000
	n /= 361
	n %= 28
	println(n)
}
```
###### 代入演算4
```kotlin
fun main() {
	val (a, b) = readLine()!!.split(' ').map { it.toInt() }
	var n = 10000
	n /= a
	n %= b
	println(n)
}
```
- - -
##### PHP
###### 代入演算1
```php
<?php
	$n = 0;
	$n += 3286;
	$n *= 4736;
	$n %= 12312;
	echo $n, PHP_EOL;
?>
```
###### 代入演算2
```php
<?php
	[$a, $b, $c] = array_map("intval", explode(' ', fgets(STDIN)));
	$n = 0;
	$n += $a;
	$n *= $b;
	$n %= $c;
	echo $n, PHP_EOL;
?>
```
###### 代入演算3
```php
<?php
	$n = 10000;
	$n /= 361;
	$n %= 28;
	echo $n, PHP_EOL;
?>
```
###### 代入演算4
```php
<?php
	[$a, $b] = array_map("intval", explode(' ', fgets(STDIN)));
	$n = 10000;
	$n /= $a;
	$n %= $b;
	echo $n, PHP_EOL;
?>
```
- - -
##### Perl
###### 代入演算1
```pl
my $n = 0;
$n += 3286;
$n *= 4736;
$n %= 12312;
print "$n$/";
```
###### 代入演算2
```pl
my ($a, $b, $c) = map { int($_) } split ' ', <STDIN>;
my $n = 0;
$n += $a;
$n *= $b;
$n %= $c;
print "$n$/";
```
###### 代入演算3
```pl
my $n = 10000;
$n /= 361;
$n %= 28;
print "$n$/";
```
###### 代入演算4
```pl
my ($a, $b, $c) = map { int($_) } split ' ', <STDIN>;
$n /= $a;
$n %= $b;
print "$n$/";
```
- - -
##### Python3
###### 代入演算1
```py
n = 0
n += 3286
n *= 4736
n %= 12312
print(n)
```
###### 代入演算2
```py
a, b, c = map(int, input().split())
n = 0
n += a
n *= b
n %= c
print(n)
```
###### 代入演算3
```py
n = 10000
n //= 361
n %= 28
print(n)
```
###### 代入演算4
```py
a, b = map(int, input().split())
n = 10000
n //= a
n %= b
print(n)
```
- - -
##### Ruby
###### 代入演算1
```rb
n = 0
n += 3286
n *= 4736
n %= 12312
p n
```
###### 代入演算2
```rb
a, b, c = gets.split.map(&:to_i) 
n = 0
n += a
n *= b
n %= c
p n
```
###### 代入演算3
```rb
n = 10000
n /= 361
n %= 28
p n
```
###### 代入演算4
```rb
a, b = gets.split.map(&:to_i) 
n = 10000
n /= a
n %= b
p n
```
- - -
##### Scala
###### 代入演算1
```scala
import scala.io.StdIn._

object Main extends App{
	var n = 0
	n += 3286
	n *= 4736
	n %= 12312
	println(n)
}
```
###### 代入演算2
```scala
import scala.io.StdIn._

object Main extends App{
	val Array(a, b, c) = readLine().split(' ').map { _.toInt }
	var n = 0
	n += a
	n *= b
	n %= c
	println(n)
}
```
###### 代入演算3
```scala
import scala.io.StdIn._

object Main extends App{
	var n = 10000
	n /= 361
	n %= 28
	println(n)
}
```
###### 代入演算4
```scala
import scala.io.StdIn._

object Main extends App{
	val Array(a, b) = readLine().split(' ').map { _.toInt }
	var n = 10000
	n /= 361
	n %= 28
	println(n)
}
```
- - -
##### Swift
###### 代入演算1
```swift
var n = 0
n += 3286
n *= 4736
n %= 12312
print(n)
```
###### 代入演算2
```swift
let abc = readLine()!.split(separator: " ").compactMap { Int($0) }
var n = 0
n += abc[0]
n *= abc[1]
n %= abc[2]
print(n)
```
###### 代入演算3
```swift
var n = 10000
n /= 361
n %= 28
print(n)
```
###### 代入演算4
```swift
let ab = readLine()!.split(separator: " ").compactMap { Int($0) }
var n = 10000
n /= ab[0]
n %= ab[1]
print(n)
```