3
1

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. 整数$a$, $b$, $c$を受け取ります
  2. $1\times a+5\times b+10\times c$を出力します
    • 「$1\times$」は不要
    • $a\times 1+b\times 5+c\times 10$と書くと算数では減点されるらしい…

C
#include <stdio.h>

int main() {
	int a, b, c;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);
	printf("%d\n", a + 5 * b + 10 * c);
	return 0;
}

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

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << a + 5 * b + 10 * c << endl;
	return 0;
}

C#
using System;

class Program
{
	public static void Main()
	{
		int a = int.Parse(Console.ReadLine());
		int b = int.Parse(Console.ReadLine());
		int c = int.Parse(Console.ReadLine());
		Console.WriteLine(a + 5 * b + 10 * c);
	}
}

Go
package main
import "fmt"

func main() {
	var a, b, c int
	fmt.Scan(&a)
	fmt.Scan(&b)
	fmt.Scan(&c)
	fmt.Println(a + 5 * b + 10 * c)
}

Java
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		sc.close();
		System.out.println(a + 5 * b + 10 * c);
	}
}

JavaScript
const [a, b, c] = require("fs").readFileSync("/dev/stdin", "utf8").split('\n').map(Number);
console.log(a + 5 * b + 10 * c);

Kotlin
import java.util.*

fun main() {
	val sc = Scanner(System.`in`)
	val a = sc.nextInt()
	val b = sc.nextInt()
	val c = sc.nextInt()
	sc.close()
	println(a + 5 * b + 10 * c)
}

PHP
<?php
	$a = intval(fgets(STDIN));
	$b = intval(fgets(STDIN));
	$c = intval(fgets(STDIN));
	echo $a + 5 * $b + 10 * $c, PHP_EOL;
?>

Perl
my $a = int(<STDIN>);
my $b = int(<STDIN>);
my $c = int(<STDIN>);
print $a + 5 * $b + 10 * $c, $/;

Python3
a = int(input())
b = int(input())
c = int(input())
print(a + 5 * b + 10 * c)

Ruby
a = gets.to_i
b = gets.to_i
c = gets.to_i
p a + 5 * b + 10 * c

Scala
import scala.io.StdIn._

object Main extends App{
	val a = readInt()
	val b = readInt()
	val c = readInt()
	println(a + 5 * b + 10 * c)
}

Swift
let a = Int(readLine()!)!
let b = Int(readLine()!)!
let c = Int(readLine()!)!
print(a + 5 * b + 10 * c)
3
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?