#include <string>
#include <vector>
#include <algorithm>
using namespace std;
long long solution(long long n) {
long long answer = 0;
vector<int> temp;
while(n) {
temp.push_back(n % 10);
n /= 10;
}
sort(temp.begin(), temp.end(), greater<int>());
for(int i = 0; i < temp.size(); ++i) {
answer = answer * 10 + temp[i];
}
return answer;
}
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
bool solution(int x) {
int sum = 0, temp = x;
while(temp != 0){
sum += temp % 10;
temp /= 10;
}
return (x%sum == 0) ? true : false;
}
풀이:
SELECT WAREHOUSE_ID, WAREHOUSE_NAME, ADDRESS, IFNULL(FREEZER_YN, 'N') AS FREEZER_YN
FROM FOOD_WAREHOUSE
WHERE ADDRESS LIKE '경기%'
ORDER BY WAREHOUSE_ID