https://www.acmicpc.net/problem/6749
6749번: Next in line
You know a family with three children. Their ages form an arithmetic sequence: the difference in ages between the middle child and youngest child is the same as the difference in ages between the oldest child and the middle child. For example, their ages c
www.acmicpc.net
코드 :
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int a, b;
cin >> a >> b;
cout << b + (b-a) << '\n';
}
'PS_Baekjoon' 카테고리의 다른 글
[백준 C++] 7595번 : Triangles (0) | 2023.04.29 |
---|---|
[백준 C++] 6763번 : Speed fines are not fine! (0) | 2023.04.28 |
[백준 C++] 5717번 : 상근이의 친구들 (0) | 2023.04.26 |
[백준 C++] 4470번 : 줄번호 (0) | 2023.04.25 |
[백준 C++] 2083번 : 럭비 클럽 (0) | 2023.04.24 |