3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【電脳少女プログラミング2088 ─壊レタ君を再構築─】「郊外のスラム街」をやってみた。

Posted at

paizaの新作プログラミングゲーム【電脳少女プログラミング2088 ─壊レタ君を再構築─】郊外のスラム街(paizaランク:D相当)をやってみました。


問題


方針
  1. 整数$n$を受け取ります
  2. $\lfloor \frac n2\rfloor+100$を出力します

C
#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	printf("%d\n", n / 2 + 100);
	return 0;
}

C++
#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	cout << n / 2 + 100 << endl;
	return 0;
}

C#
using System;

class Program
{
	public static voidn Main()
	{
		int n = int.Parse(Console.ReadLine());
		Console.WriteLine(n / 2 + 100);
	}
}

Go
package main
import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	fmt.Println(n / 2 + 100)
}

Java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.next();
		sc.close();
		System.out.println(n / 2 + 100);
	}
}

JavaScript
n = Number(require("fs").readFileSync("/dev/stdin", "utf8"));
console.log(Math.floor(n / 2) + 100);

Kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val n = sc.next()
	sc.close()
	println(n / 2 + 100)
}

PHP
<?php
	$n = intval(fgets(STDIN))
	echo intval($n / 2) + 100, PHP_EOL;
?>

Perl
$n = int(<STDIN>);
print int($n / 2) + 100, $/;

Python3
n = int(input())
print(n // 2 + 100)

Ruby
n = gets.to_i
p n / 2 + 100

Scala
import scala.io.StdIn._

object Main extends App{
	val n = readInt()
	println(n / 2 + 100)
}

Swift
let n = Int(readLine()!)!
print(n / 2 + 100)
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?