웅재의 코딩세상
[프로그래머스] 사칙연산1 본문
- 두 수의 합
#include <string>
#include <vector>
using namespace std;
int solution(int num1, int num2){
return num1 + num2;
}
- 두 수의 차
#include <string>
#include <vector>
using namespace std;
int solution(int num1, int num2){
return num1 - num2;
}
- 두 수의 곱
#include <string>
#include <vector>
using namespace std;
int solution(int num1, int num2){
return num1 * num2;
}
- 몫 구하기
#include <string>
#include <vector>
using namespace std;
int solution(int num1, int num2) {
return num1 / num2;
}
반응형
'코딩테스트 > 프로그래머스 - LV 0' 카테고리의 다른 글
[프로그래머스] 사칙연산2 (0) | 2024.01.02 |
---|---|
[프로그래머스] 배열 두 배 만들기 (1) | 2024.01.02 |
[프로그래머스] 분수의 덧셈 (0) | 2024.01.02 |
[프로그래머스] 숫자 비교하기 (0) | 2024.01.01 |
[프로그래머스] 두 수의 나눗셈 (0) | 2024.01.01 |