AT_abc469_a.Train Car
入门
通过率:0%
时间限制:2.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
There is a train consisting of N cars. What is the position, counted from the back, of the car that is K-th from the front of this train?
有一列由 N 节车厢组成的火车。从车尾开始计数,这列火车中从车头开始数第 K 节车厢的位置是多少?
输入格式
The input is given from Standard Input in the following format:
N K
输入从标准输入中以如下格式给出:
N K
输出格式
If the car is X-th from the back, output the integer X in one line.
如果该车从后往前数是第 X 辆,则在一行中输出整数 X。
输入输出样例
输入#1
5 2
输出#1
4
输入#2
1 1
输出#2
1
输入#3
99 50
输出#3
50
说明/提示
Sample 1 Explanation:
For a train consisting of five cars, the car that is second from the front is fourth from the back.
Constraints
- 1≤K≤N≤100
- All input values are integers.
样例 1 解释:
对于一列由五节车厢组成的列车,从车头数起第二节车厢,是从车尾数起第四节车厢。
约束条件
- 1≤K≤N≤100
- 所有输入值均为整数。
输入解题思路,AI测评打分。不知道怎么写?