A,B,C,D를 정렬 한 후 1,3번째 수를 곱해주면 된다.


<코드>

1
2
3
4
5
6
7
8
9
10
11
12
#include <algorithm>
#include <stdio.h>
using namespace std;
 
int a[4];
 
int main() {
    for (int i = 0; i < 4; i++scanf("%d"&a[i]);
    sort(a, a + 4);
    printf("%d\n", a[0* a[2]);
    return 0;
}
cs


'BOJ' 카테고리의 다른 글

7579 앱  (0) 2017.10.03
6679 싱기한 네자리 숫자  (0) 2017.10.03
1874 스택수열  (0) 2017.10.03
1992 쿼드트리  (0) 2017.10.03
1322 X와 K  (0) 2017.10.03

+ Recent posts