코딩로그
[백준/BOJ/C++] 8370번 Plane 본문
[문제]
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.
[Source Code]
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int businessrow, businessseat, econimicrow, economicseat, result = 0;
cin >> businessrow >> businessseat >> econimicrow >> economicseat;
result = businessrow * businessseat + econimicrow * economicseat;
cout << result;
}
[결과 화면]
'YJ > C++' 카테고리의 다른 글
[백준/BOJ/C++] 2738번 행렬 덧셈 (0) | 2021.10.26 |
---|---|
[백준/BOJ/C++] 5691번 평균 중앙값 문제 (0) | 2021.10.26 |
[백준/BOJ/C++] 10093번 숫자 (0) | 2021.10.22 |
[백준/BOJ/C++] 7891번 Can you add this? (0) | 2021.10.22 |
[백준/BOJ/C++] 16170번 오늘의 날짜는? (0) | 2021.10.22 |