본문 바로가기

algorithm

(54)
바킹독 (기초, 백준) 2576 #include using namespace std; int arr[7]; int main(void) { ios::sync_with_stdio(0); cin.tie(0); memset(arr, 100, sizeof(arr)); int tmp, sum, mi; sum = 0; for (int i = 0; i > tmp; if (tmp % 2 == 1) { sum += tmp; arr[i] = tmp; } } if (sum) { sort(arr, arr + 7); cout
바킹독 (기초, 백준) 2562 #include using namespace std; int n, maxvalue, maxindex; int main(void){ ios::sync_with_stdio(0); cin.tie(0); for(int i = 1; i > n; if(maxvalue < n){ maxvalue = n; maxindex = i; } } cout
바킹독 (기초, 백준) 2557 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cout
바킹독 (기초, 백준) 2490 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int tmp, check; for (int i = 0; i > tmp; if (tmp) check++; } if (check == 1) cout
바킹독 (기초, 백준) 2480 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int ret; int arr[3]; ret = 0; cin >> arr[0] >> arr[1] >> arr[2]; if ((arr[0] == arr[1]) && (arr[1] == arr[2])) ret = (arr[0] * 1000) + 10000; else if (arr[0] == arr[1] || arr[0] == arr[2]) ret = (arr[0] * 100) + 1000; else if (arr[1] == arr[2]) ret = (arr[1] * 100) + 1000; else { ret = max(arr[0], arr[1]); ret = ..
바킹독 (기초, 백준) 2446 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 1; i < n + 1; i++) { for (int j = 1; j < i; j++) cout
바킹독 (기초, 백준) 2445 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 1; i < n; i++) { for (int j = 0; j < i; j++) cout
바킹독 (기초, 백준) 2443 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 1; i < n + 1; i++) { for (int j = 1; j < i; j++) cout
바킹독 (기초, 백준) 2442 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 1; i < n + 1; i++) { for (int j = 0; j < n - i; j++) cout
바킹독 (기초, 백준) 2441 #include using namespace std; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int f, s, n; cin >> n; for (int i = 0; i < n; i++) { for (int j = 0; j < i; j++) cout