시작은 미미하나 끝은 쥬쥬하리라.

PS/Baek-Joon C++

[백준 C++] 단계별 문제풀이 2단계 <조건문>

코딩뚜벅이 2024. 1. 24. 21:16

단계별 문제풀이 2단계


단계별 문제풀이 2단계는 조건문에 해당하는 단계입니다, 문제는 총 7문제 입니다.

 
1. 두 수 비교하기

[백준 C++] 단계별 문제풀이 2단계 < 1330 : 두 수 비교하기 >

두 수 비교하기 문제 풀이 결과 문제 풀이 #include using namespace std; int main() { int a, b = 0; cin >> a >> b; if (a > b) { cout

tiptapcoding.tistory.com

 
2. 시험 성적

[백준 C++] 단계별 문제풀이 2단계 < 9498 : 시험 성적 >

시험 성적 문제 풀이 결과 문제 풀이 #include using namespace std; int main() { int nScore = 0; while(1) { cin >> nScore; if (nScore < 0 || 100 < nScore) { cout

tiptapcoding.tistory.com

 
3. 윤년

[백준 C++] 단계별 문제풀이 2단계 < 2753 : 윤년 >

윤년 문제 풀이 결과 문제 풀이 #include using namespace std; int main() { int nYear = 0; while(1) { cin >> nYear; if (nYear < 1 || 4000 < nYear) { cout

tiptapcoding.tistory.com

 
4. 사분면 고르기

[백준 C++] 단계별 문제풀이 2단계 < 14681 : 사분면 고르기 >

사분면 고르기 문제 풀이 결과 문제 풀이 #include using namespace std; int main() { int nX = 0; int nY = 0; while(1) { cin >> nX; cin >> nY; if (nX < -1000 || 1000 < nX || nX == 0) { cout

tiptapcoding.tistory.com

 
5. 알람 시계

[백준 C++] 단계별 문제풀이 2단계 < 2884 : 알람 시계 >

알람 시계 문제 풀이 결과 문제 풀이 #include using namespace std; int main() { int nHour = 0; int nMinute = 0; while(1) { cin >> nHour; cin >> nMinute; if (nHour < 0 || 23 < nHour) { cout

tiptapcoding.tistory.com

 
6. 오븐 시계

[백준 C++] 단계별 문제풀이 2단계 < 2525 : 오븐 시계 >

오븐 시계문제풀이결과문제 풀이#include using namespace std; int main() { int nHour, nMinute, nInput; while(1) { cin >> nHour >> nMinute; cin >> nInput; if (nHour < 0 || 23 < nHour) { cout

tiptapcoding.tistory.com


 
7. 주사위 세개

[백준 C++] 단계별 문제풀이 2단계 < 2480 : 주사위 세개 >

주사위 세개 문제 풀이 결과 문제 풀이 #include #include using namespace std; int main() { int nDice[3]; cin >> nDice[0] >> nDice[1] >> nDice[2]; // 오름차순 정렬 (sort() : 배열, 배열 바로 다음 요소를 인자로) sort(nDice, nD

tiptapcoding.tistory.com