문제 링크입니다: www.acmicpc.net/problem/2845
2845번: 파티가 끝나고 난 뒤
파티가 끝나고 나면, 사람들은 누가 파티에 왔는지와 얼마나 많은 사람들이 왔는지를 궁금해한다. 보통 파티는 매우 크게 열리기 때문에, 정확하게 몇 명이 참가했는지 알 수가 없다. 지난주 토
www.acmicpc.net
간단한 수학 문제였습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
const int MAX = 5; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
int L, P; | |
cin >> L >> P; | |
int actualPeopleCnt = L * P; | |
for (int i = 0; i < MAX; i++) | |
{ | |
int peopleCnt; | |
cin >> peopleCnt; | |
cout << peopleCnt - actualPeopleCnt << " "; | |
} | |
cout << "\n"; | |
return 0; | |
} |


지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 3003번 킹, 퀸, 룩, 비숍, 나이트, 폰 (0) | 2021.03.06 |
---|---|
백준 2914번 저작권 (0) | 2021.03.05 |
[KOI 초등부] 백준 2475번 검증수 (0) | 2021.03.05 |
백준 2338번 긴자리 계산 (C++) (0) | 2021.03.05 |
백준 1550번 16진수 (0) | 2021.03.04 |