https://www.acmicpc.net/problem/8370
문제
Byteland Airlines recently extended their aircraft fleet with a new model of a plane. The new acquisition has n1 rows of seats in the business class and n2 rows in the economic class. In the business class each row contains k1 seats, while each row in the economic class has k2 seats.
Write a program which:
- reads information about available seats in the plane,
- calculates the sum of all seats available in that plane,
- writes the result.
입력
In the first and only line of the standard input there are four integers n1, k1, n2 and k2 (1 ≤ n1, k1, n2, k2 ≤ 1 000), separated by single spaces.
출력
The first and only line of the standard output should contain one integer - the total number of seats available in the plane.
예제 입력 1
2 5 3 20
예제 출력 1
70
코드
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
using namespace std;
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cmath>
#include <map>
#include <set>
#define _CRT_SECURE_NO_WARNINGS
#define INF 987654321
#define ll long long
typedef pair<int, int> PII;
int main() {
int n1, n2, k1, k2;
cin >> n1 >> k1 >> n2 >> k2;
cout << n1 * k1 + n2 * k2 << "\n";
return 0;
}
|
cs |
728x90
반응형
'🔻PS > Baekjoon' 카테고리의 다른 글
[Baekjoon] 백준 2953 나는 요리사다 C++ (0) | 2022.10.17 |
---|---|
[Baekjoon] 백준 2720 세탁소 사장 동혁 C++ (0) | 2022.10.14 |
[Baekjoon] 백준 10707 수도요금 C++ (0) | 2022.10.12 |
[Baekjoon] 백준 23794 골뱅이 찍기 - 정사각형 C++ (0) | 2022.10.07 |
[Baekjoon] 백준 7600 문자가 몇갤까 C++ (0) | 2022.10.04 |