AtCoder Beginner Contest Edit

【pythonでABC193を解説】A - Discount

問題概要

問題ページ

[st-card-ex url="https://atcoder.jp/contests/abc193/tasks/abc193_a" target="_blank" rel="nofollow" label="" name="" bgcolor="" color="" readmore="問題ページへ移動する"]

問題文

定価 \(A\) 円の商品が \(B\) 円で売られているとき、この商品の売値は定価の何パーセント引きですか?

制約

  • \(A, B\) は整数
  • \(1 ≤ B < A ≤ 10^5\)

問題の考察

ACコード

import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    a, b = list(map(int, input().rstrip('\n').split()))
    print((a - b) / a * 100)


if __name__ == '__main__':
    solve()

プログラミング

-AtCoder Beginner Contest, Edit
-