문제 링크입니다: https://www.acmicpc.net/problem/5717
5717번: 상근이의 친구들
입력은 여러 개의 테스트 케이스로 이루어져 있다. 각 테스트 케이스는 두 정수 M과 F로 이루어져 있으며, 각각은 상근이의 남자 친구의 수와 여자 친구의 수이다. (1 ≤ M, F ≤ 5) 입력의 마지막
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; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
while (1) | |
{ | |
int M, F; | |
cin >> M >> F; | |
if (M == 0 && F == 0) | |
{ | |
break; | |
} | |
int result = M + F; | |
cout << result << "\n"; | |
} | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 6060번 Wheel Rotation (0) | 2021.05.29 |
---|---|
백준 5751번 Head or Tail (0) | 2021.05.29 |
백준 5692번 팩토리얼 진법 (0) | 2021.05.29 |
백준 5666번 Hot Dogs (1) | 2021.05.27 |
백준 5618번 공약수 (0) | 2021.05.26 |